diff options
author | rillig <rillig> | 2005-05-16 09:32:16 +0000 |
---|---|---|
committer | rillig <rillig> | 2005-05-16 09:32:16 +0000 |
commit | 850dbc2dcd6b8d77731eba8ba92d175bfde1f483 (patch) | |
tree | be3d64dc78c1fc8944984191fa7f4254c4598be9 | |
parent | 70f1386de948b8258493ba32db0c4f6dc583da07 (diff) | |
download | pkgsrc-850dbc2dcd6b8d77731eba8ba92d175bfde1f483.tar.gz |
Updated from the current pkgsrc guide.
-rw-r--r-- | doc/pkgsrc.html | 2212 | ||||
-rw-r--r-- | doc/pkgsrc.txt | 628 |
2 files changed, 1629 insertions, 1211 deletions
diff --git a/doc/pkgsrc.html b/doc/pkgsrc.html index d11f0922616..1bc6da6a604 100644 --- a/doc/pkgsrc.html +++ b/doc/pkgsrc.html @@ -19,8 +19,8 @@ alink="#0000FF"> <div class="titlepage"> <div> <div> - <h1 class="title"><a name="id2510574" id= - "id2510574"></a>The pkgsrc guide</h1> + <h1 class="title"><a name="id2598171" id= + "id2598171"></a>The pkgsrc guide</h1> </div> <div> @@ -66,8 +66,8 @@ alink="#0000FF"> </div> <div xmlns="http://www.w3.org/TR/xhtml1/transitional"> - <p xmlns="" class="pubdate">$NetBSD: pkgsrc.xml,v 1.5 - 2005/05/10 00:27:43 rillig Exp $</p> + <p xmlns="" class="pubdate">$NetBSD: pkgsrc.xml,v 1.6 + 2005/05/15 20:32:27 rillig Exp $</p> </div> <div> @@ -93,7 +93,7 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2623537">1.1. + <dt><span class="sect1"><a href="#id2568707">1.1. Introduction</a></span></dt> <dt><span class="sect1"><a href="#overview">1.2. @@ -117,13 +117,13 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2569236">2.1. + <dt><span class="sect1"><a href="#id2569429">2.1. As tar file</a></span></dt> - <dt><span class="sect1"><a href="#id2569252">2.2. + <dt><span class="sect1"><a href="#id2569445">2.2. Via SUP</a></span></dt> - <dt><span class="sect1"><a href="#id2569420">2.3. + <dt><span class="sect1"><a href="#id2569477">2.3. Via CVS</a></span></dt> </dl> </dd> @@ -133,35 +133,35 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2569530">3.1. + <dt><span class="sect1"><a href="#id2569587">3.1. Bootstrapping pkgsrc</a></span></dt> - <dt><span class="sect1"><a href="#id2569712">3.2. + <dt><span class="sect1"><a href="#id2569768">3.2. Platform specific notes</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2569718">3.2.1. Darwin (Mac OS + "#id2569774">3.2.1. Darwin (Mac OS X)</a></span></dt> <dt><span class="sect2"><a href= - "#id2569880">3.2.2. FreeBSD</a></span></dt> + "#id2569937">3.2.2. FreeBSD</a></span></dt> <dt><span class="sect2"><a href= - "#id2570324">3.2.3. Interix</a></span></dt> + "#id2570449">3.2.3. Interix</a></span></dt> <dt><span class="sect2"><a href= - "#id2570557">3.2.4. IRIX</a></span></dt> + "#id2570750">3.2.4. IRIX</a></span></dt> <dt><span class="sect2"><a href= - "#id2570654">3.2.5. Linux</a></span></dt> + "#id2570848">3.2.5. Linux</a></span></dt> <dt><span class="sect2"><a href= - "#id2570723">3.2.6. OpenBSD</a></span></dt> + "#id2570916">3.2.6. OpenBSD</a></span></dt> <dt><span class="sect2"><a href= - "#id2570835">3.2.7. Solaris</a></span></dt> + "#id2571028">3.2.7. Solaris</a></span></dt> </dl> </dd> </dl> @@ -179,38 +179,38 @@ alink="#0000FF"> <dd> <dl> <dt><span class="sect2"><a href= - "#id2571040">4.1.1. Where to get binary + "#id2571164">4.1.1. Where to get binary packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2571080">4.1.2. How to use binary + "#id2571218">4.1.2. How to use binary packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2571256">4.1.3. A word of + "#id2571392">4.1.3. A word of warning</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2571336">4.2. + <dt><span class="sect1"><a href="#id2571949">4.2. Building packages from source</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2571346">4.2.1. + "#id2571960">4.2.1. Requirements</a></span></dt> <dt><span class="sect2"><a href= - "#id2571366">4.2.2. Fetching + "#id2571980">4.2.2. Fetching distfiles</a></span></dt> <dt><span class="sect2"><a href= - "#id2571828">4.2.3. How to build and + "#id2572094">4.2.3. How to build and install</a></span></dt> <dt><span class="sect2"><a href= - "#id2623831">4.2.4. Selecting the + "#id2623825">4.2.4. Selecting the compiler</a></span></dt> </dl> </dd> @@ -222,10 +222,10 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2623917">5.1. + <dt><span class="sect1"><a href="#id2623979">5.1. Building a single binary package</a></span></dt> - <dt><span class="sect1"><a href="#id2623995">5.2. + <dt><span class="sect1"><a href="#id2624057">5.2. Settings for creation of binary packages</a></span></dt> @@ -239,26 +239,26 @@ alink="#0000FF"> Configuration</a></span></dt> <dt><span class="sect2"><a href= - "#id2624142">5.3.2. Other environmental + "#id2624204">5.3.2. Other environmental considerations</a></span></dt> <dt><span class="sect2"><a href= - "#id2624183">5.3.3. Operation</a></span></dt> + "#id2624245">5.3.3. Operation</a></span></dt> <dt><span class="sect2"><a href= - "#id2624252">5.3.4. What it + "#id2624382">5.3.4. What it does</a></span></dt> <dt><span class="sect2"><a href= - "#id2624309">5.3.5. Disk space + "#id2624439">5.3.5. Disk space requirements</a></span></dt> <dt><span class="sect2"><a href= - "#id2624336">5.3.6. Setting up a sandbox for + "#id2624466">5.3.6. Setting up a sandbox for chroot'ed builds</a></span></dt> <dt><span class="sect2"><a href= - "#id2624865">5.3.7. Building a partial set of + "#id2624926">5.3.7. Building a partial set of packages</a></span></dt> <dt><span class="sect2"><a href= @@ -267,14 +267,14 @@ alink="#0000FF"> </dl> </dd> - <dt><span class="sect1"><a href="#id2625321">5.4. + <dt><span class="sect1"><a href="#id2625383">5.4. Creating a multiple CD-ROM packages collection</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2625336">5.4.1. Example of + "#id2625398">5.4.1. Example of cdpack</a></span></dt> </dl> </dd> @@ -286,54 +286,54 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2625528">6.1. + <dt><span class="sect1"><a href="#id2625590">6.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> - <dt><span class="sect1"><a href="#id2625662">6.2. + <dt><span class="sect1"><a href="#id2625724">6.2. Where's the pkgviews documentation?</a></span></dt> <dt><span class="sect1"><a href= "#faq-pkgtools">6.3. Utilities for package management (pkgtools)</a></span></dt> - <dt><span class="sect1"><a href="#id2625984">6.4. + <dt><span class="sect1"><a href="#id2625987">6.4. How to use pkgsrc as non-root</a></span></dt> - <dt><span class="sect1"><a href="#id2625995">6.5. + <dt><span class="sect1"><a href="#id2625998">6.5. How to resume transfers when fetching distfiles?</a></span></dt> - <dt><span class="sect1"><a href="#id2626045">6.6. + <dt><span class="sect1"><a href="#id2626049">6.6. How can I install/use XFree86 from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2626073">6.7. + <dt><span class="sect1"><a href="#id2626076">6.7. How can I install/use X.org from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2626101">6.8. + <dt><span class="sect1"><a href="#id2626104">6.8. How to fetch files from behind a firewall</a></span></dt> - <dt><span class="sect1"><a href="#id2626115">6.9. + <dt><span class="sect1"><a href="#id2626118">6.9. How do I tell <span><strong class="command">make fetch</strong></span> to do passive FTP?</a></span></dt> - <dt><span class="sect1"><a href="#id2626166">6.10. + <dt><span class="sect1"><a href="#id2626169">6.10. How to fetch all distfiles at once</a></span></dt> - <dt><span class="sect1"><a href="#id2626313">6.11. + <dt><span class="sect1"><a href="#id2626453">6.11. What does “<span class="quote">Don't know how to make /usr/share/tmac/tmac.andoc</span>” mean?</a></span></dt> - <dt><span class="sect1"><a href="#id2626352">6.12. + <dt><span class="sect1"><a href="#id2626491">6.12. What does “<span class="quote">Could not find bsd.own.mk</span>” mean?</a></span></dt> - <dt><span class="sect1"><a href="#id2626409">6.13. + <dt><span class="sect1"><a href="#id2626549">6.13. Using 'sudo' with pkgsrc</a></span></dt> <dt><span class="sect1"><a href="#faq.conf">6.14. @@ -353,81 +353,97 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="chapter"><a href="#makefile">7. - Programming in <code class= - "filename">Makefile</code>s</a></span></dt> - - <dd> - <dl> - <dt><span class="sect1"><a href= - "#makefile.variables">7.1. <code class= - "filename">Makefile</code> - variables</a></span></dt> - - <dt><span class="sect1"><a href= - "#makefile.code">7.2. Code snippets</a></span></dt> - - <dd> - <dl> - <dt><span class="sect2"><a href= - "#id2627035">7.2.1. Adding things to a - list</a></span></dt> - - <dt><span class="sect2"><a href= - "#id2627113">7.2.2. Converting an internal list - into an external list</a></span></dt> - - <dt><span class="sect2"><a href= - "#id2627131">7.2.3. Passing variables to a - shell command</a></span></dt> - </dl> - </dd> - </dl> - </dd> - - <dt><span class="chapter"><a href="#components">8. + <dt><span class="chapter"><a href="#components">7. Package components - files, directories and contents</a></span></dt> <dd> <dl> <dt><span class="sect1"><a href= - "#components.Makefile">8.1. <code class= + "#components.Makefile">7.1. <code class= "filename">Makefile</code></a></span></dt> <dt><span class="sect1"><a href= - "#components.distinfo">8.2. <code class= + "#components.distinfo">7.2. <code class= "filename">distinfo</code></a></span></dt> <dt><span class="sect1"><a href= - "#components.patches">8.3. + "#components.patches">7.3. patches/*</a></span></dt> - <dt><span class="sect1"><a href="#id2627827">8.4. + <dt><span class="sect1"><a href="#id2627632">7.4. Other mandatory files</a></span></dt> <dt><span class="sect1"><a href= - "#components.optional">8.5. Optional + "#components.optional">7.5. Optional files</a></span></dt> - <dt><span class="sect1"><a href="#id2628089">8.6. + <dt><span class="sect1"><a href="#id2627757">7.6. <code class="filename">work*</code></a></span></dt> - <dt><span class="sect1"><a href="#id2628177">8.7. + <dt><span class="sect1"><a href="#id2627845">7.7. <code class= "filename">files/*</code></a></span></dt> </dl> </dd> + <dt><span class="chapter"><a href="#makefile">8. + Programming in <code class= + "filename">Makefile</code>s</a></span></dt> + + <dd> + <dl> + <dt><span class="sect1"><a href= + "#makefile.variables">8.1. <code class= + "filename">Makefile</code> + variables</a></span></dt> + + <dd> + <dl> + <dt><span class="sect2"><a href= + "#makefile.variables.names">8.1.1. Naming + conventions</a></span></dt> + </dl> + </dd> + + <dt><span class="sect1"><a href= + "#makefile.code">8.2. Code snippets</a></span></dt> + + <dd> + <dl> + <dt><span class="sect2"><a href= + "#id2628274">8.2.1. Adding things to a + list</a></span></dt> + + <dt><span class="sect2"><a href= + "#id2628283">8.2.2. Converting an internal list + into an external list</a></span></dt> + + <dt><span class="sect2"><a href= + "#id2628305">8.2.3. Passing variables to a + shell command</a></span></dt> + + <dt><span class="sect2"><a href= + "#id2628426">8.2.4. Quoting + guideline</a></span></dt> + + <dt><span class="sect2"><a href= + "#id2628677">8.2.5. Workaround for a bug in BSD + Make</a></span></dt> + </dl> + </dd> + </dl> + </dd> + <dt><span class="chapter"><a href="#plist">9. PLIST issues</a></span></dt> <dd> <dl> - <dt><span class="sect1"><a href="#id2628231">9.1. + <dt><span class="sect1"><a href="#id2628738">9.1. RCS ID</a></span></dt> - <dt><span class="sect1"><a href="#id2628246">9.2. + <dt><span class="sect1"><a href="#id2628753">9.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> @@ -439,14 +455,14 @@ alink="#0000FF"> <dt><span class="sect1"><a href="#plist.misc">9.4. Variable substitution in PLIST</a></span></dt> - <dt><span class="sect1"><a href="#id2628499">9.5. + <dt><span class="sect1"><a href="#id2629074">9.5. Manpage-compression</a></span></dt> - <dt><span class="sect1"><a href="#id2628609">9.6. + <dt><span class="sect1"><a href="#id2629115">9.6. Changing PLIST source with <code class= "varname">PLIST_SRC</code></a></span></dt> - <dt><span class="sect1"><a href="#id2628633">9.7. + <dt><span class="sect1"><a href="#id2629140">9.7. Platform specific and differing PLISTs</a></span></dt> @@ -461,22 +477,22 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2628968">10.1. + <dt><span class="sect1"><a href="#id2629406">10.1. Converting packages to use buildlink3</a></span></dt> - <dt><span class="sect1"><a href="#id2629149">10.2. + <dt><span class="sect1"><a href="#id2629724">10.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2629219">10.2.1. Anatomy of a buildlink3.mk + "#id2629794">10.2.1. Anatomy of a buildlink3.mk file</a></span></dt> <dt><span class="sect2"><a href= - "#id2629796">10.2.2. Updating <code class= + "#id2630166">10.2.2. Updating <code class= "varname">BUILDLINK_DEPENDS.<em class= "replaceable"><code>pkg</code></em></code> in <code class="filename">buildlink3.mk</code> @@ -484,19 +500,19 @@ alink="#0000FF"> </dl> </dd> - <dt><span class="sect1"><a href="#id2629943">10.3. + <dt><span class="sect1"><a href="#id2630245">10.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2630024">10.3.1. Anatomy of a <code class= + "#id2630394">10.3.1. Anatomy of a <code class= "filename">builtin.mk</code> file</a></span></dt> <dt><span class="sect2"><a href= - "#id2630183">10.3.2. Global preferences for + "#id2630621">10.3.2. Global preferences for native or pkgsrc software</a></span></dt> </dl> </dd> @@ -508,10 +524,10 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2630256">11.1. + <dt><span class="sect1"><a href="#id2630762">11.1. Global default options</a></span></dt> - <dt><span class="sect1"><a href="#id2630270">11.2. + <dt><span class="sect1"><a href="#id2630777">11.2. Converting packages to use <code class= "filename">bsd.options.mk</code></a></span></dt> </dl> @@ -526,7 +542,7 @@ alink="#0000FF"> "#build.prefix">12.1. Program location</a></span></dt> - <dt><span class="sect1"><a href="#id2631098">12.2. + <dt><span class="sect1"><a href="#id2631337">12.2. Main targets</a></span></dt> <dt><span class="sect1"><a href= @@ -540,17 +556,17 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2632458">13.1. + <dt><span class="sect1"><a href="#id2632834">13.1. General operation</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2632461">13.1.1. How to pull in variables + "#id2632837">13.1.1. How to pull in variables from /etc/mk.conf</a></span></dt> <dt><span class="sect2"><a href= - "#id2632545">13.1.2. Restricted + "#id2632920">13.1.2. Restricted packages</a></span></dt> <dt><span class="sect2"><a href= @@ -558,15 +574,15 @@ alink="#0000FF"> dependencies</a></span></dt> <dt><span class="sect2"><a href= - "#id2633066">13.1.4. Handling conflicts with + "#id2633373">13.1.4. Handling conflicts with other packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2633116">13.1.5. Packages that cannot or + "#id2633492">13.1.5. Packages that cannot or should not be built</a></span></dt> <dt><span class="sect2"><a href= - "#id2633142">13.1.6. Packages which should not + "#id2633517">13.1.6. Packages which should not be deleted, once installed</a></span></dt> <dt><span class="sect2"><a href= @@ -574,37 +590,37 @@ alink="#0000FF"> with security problems</a></span></dt> <dt><span class="sect2"><a href= - "#id2633234">13.1.8. How to handle compiler + "#id2633677">13.1.8. How to handle compiler bugs</a></span></dt> <dt><span class="sect2"><a href= - "#id2633324">13.1.9. How to handle incrementing + "#id2633700">13.1.9. How to handle incrementing versions when fixing an existing package</a></span></dt> <dt><span class="sect2"><a href= - "#id2633373">13.1.10. Portability of + "#id2633817">13.1.10. Portability of packages</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2633398">13.2. + <dt><span class="sect1"><a href="#id2633842">13.2. Possible downloading issues</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2633401">13.2.1. Packages whose distfiles + "#id2633845">13.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt> <dt><span class="sect2"><a href= - "#id2633601">13.2.2. How to handle modified + "#id2633908">13.2.2. How to handle modified distfiles with the 'old' name</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2633612">13.3. + <dt><span class="sect1"><a href="#id2633920">13.3. Configuration gotchas</a></span></dt> <dd> @@ -614,66 +630,66 @@ alink="#0000FF"> libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2633978">13.3.2. Using libtool on GNU + "#id2634285">13.3.2. Using libtool on GNU packages that already support libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2634059">13.3.3. GNU + "#id2634503">13.3.3. GNU Autoconf/Automake</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2634104">13.4. + <dt><span class="sect1"><a href="#id2634616">13.4. Building considerations</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2634107">13.4.1. CPP + "#id2634619">13.4.1. CPP defines</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2634137">13.5. + <dt><span class="sect1"><a href="#id2634649">13.5. Package specific actions</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2634140">13.5.1. Package configuration + "#id2634652">13.5.1. Package configuration files</a></span></dt> <dt><span class="sect2"><a href= - "#id2634311">13.5.2. User + "#id2634755">13.5.2. User interaction</a></span></dt> <dt><span class="sect2"><a href= - "#id2634492">13.5.3. Handling + "#id2634800">13.5.3. Handling licenses</a></span></dt> <dt><span class="sect2"><a href= - "#id2634644">13.5.4. Creating an account from a + "#id2634951">13.5.4. Creating an account from a package</a></span></dt> <dt><span class="sect2"><a href= - "#id2634706">13.5.5. Installing score + "#id2635013">13.5.5. Installing score files</a></span></dt> <dt><span class="sect2"><a href= - "#id2634749">13.5.6. Packages providing login + "#id2635057">13.5.6. Packages providing login shells</a></span></dt> <dt><span class="sect2"><a href= - "#id2634807">13.5.7. Packages containing perl + "#id2635114">13.5.7. Packages containing perl scripts</a></span></dt> <dt><span class="sect2"><a href= - "#id2634825">13.5.8. Packages with hardcoded + "#id2635132">13.5.8. Packages with hardcoded paths to other interpreters</a></span></dt> <dt><span class="sect2"><a href= - "#id2634846">13.5.9. Packages installing perl + "#id2635154">13.5.9. Packages installing perl modules</a></span></dt> <dt><span class="sect2"><a href= @@ -681,40 +697,40 @@ alink="#0000FF"> info files</a></span></dt> <dt><span class="sect2"><a href= - "#id2635134">13.5.11. Packages installing + "#id2635510">13.5.11. Packages installing GConf2 data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2635303">13.5.12. Packages installing + "#id2635678">13.5.12. Packages installing scrollkeeper data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2635354">13.5.13. Packages installing X11 + "#id2635730">13.5.13. Packages installing X11 fonts</a></span></dt> <dt><span class="sect2"><a href= - "#id2635469">13.5.14. Packages installing GTK2 + "#id2635777">13.5.14. Packages installing GTK2 modules</a></span></dt> <dt><span class="sect2"><a href= - "#id2635539">13.5.15. Packages installing SGML + "#id2635846">13.5.15. Packages installing SGML or XML data</a></span></dt> <dt><span class="sect2"><a href= - "#id2635659">13.5.16. Packages installing + "#id2635898">13.5.16. Packages installing extensions to the MIME database</a></span></dt> <dt><span class="sect2"><a href= - "#id2635730">13.5.17. Packages using + "#id2636037">13.5.17. Packages using intltool</a></span></dt> <dt><span class="sect2"><a href= - "#id2635744">13.5.18. Packages installing + "#id2636051">13.5.18. Packages installing startup scripts</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2635765">13.6. + <dt><span class="sect1"><a href="#id2636072">13.6. Feedback to the author</a></span></dt> </dl> </dd> @@ -727,18 +743,18 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2636227">15.1. + <dt><span class="sect1"><a href="#id2636739">15.1. Submitting your packages</a></span></dt> - <dt><span class="sect1"><a href="#id2636284">15.2. + <dt><span class="sect1"><a href="#id2636796">15.2. Committing: Importing a package into CVS</a></span></dt> - <dt><span class="sect1"><a href="#id2636484">15.3. + <dt><span class="sect1"><a href="#id2636859">15.3. Updating a package to a newer version</a></span></dt> - <dt><span class="sect1"><a href="#id2636503">15.4. + <dt><span class="sect1"><a href="#id2636878">15.4. Moving a package in pkgsrc</a></span></dt> </dl> </dd> @@ -750,27 +766,27 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2636729">A.1. + <dt><span class="sect1"><a href="#id2637036">A.1. files</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2636732">A.1.1. + <dt><span class="sect2"><a href="#id2637040">A.1.1. Makefile</a></span></dt> - <dt><span class="sect2"><a href="#id2636740">A.1.2. + <dt><span class="sect2"><a href="#id2637047">A.1.2. DESCR</a></span></dt> - <dt><span class="sect2"><a href="#id2636755">A.1.3. + <dt><span class="sect2"><a href="#id2637062">A.1.3. PLIST</a></span></dt> - <dt><span class="sect2"><a href="#id2636762">A.1.4. + <dt><span class="sect2"><a href="#id2637069">A.1.4. Checking a package with <span><strong class= "command">pkglint</strong></span></a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2636803">A.2. Steps + <dt><span class="sect1"><a href="#id2637110">A.2. Steps for building, installing, packaging</a></span></dt> </dl> </dd> @@ -796,10 +812,10 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2637654">D.1. + <dt><span class="sect1"><a href="#id2637893">D.1. Targets</a></span></dt> - <dt><span class="sect1"><a href="#id2637856">D.2. + <dt><span class="sect1"><a href="#id2637958">D.2. Procedure</a></span></dt> </dl> </dd> @@ -820,7 +836,7 @@ alink="#0000FF"> <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2623537">1.1. + <dt><span class="sect1"><a href="#id2568707">1.1. Introduction</a></span></dt> <dt><span class="sect1"><a href="#overview">1.2. @@ -839,8 +855,8 @@ alink="#0000FF"> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2623537" id= - "id2623537"></a>1.1. Introduction</h2> + "id2568707" id= + "id2568707"></a>1.1. Introduction</h2> </div> </div> </div> @@ -1049,10 +1065,10 @@ alink="#0000FF"> <dd> <p>This is the former name of “<span class= "quote">pkgsrc</span>”. It is part of the - NetBSD operating system and can be bootstrap to run - on non-NetBSD operating systems as well. It handles - building (compiling), installing, and removing of - packages.</p> + NetBSD operating system and can be bootstrapped to + run on non-NetBSD operating systems as well. It + handles building (compiling), installing, and + removing of packages.</p> </dd> <dt><span class="term">Distfile</span></dt> @@ -1126,7 +1142,7 @@ alink="#0000FF"> or if “<span class="quote">normal</span>” user privileges are sufficient. We use a <code class= "prompt">#</code> for root's shell prompt, and a - <code class="prompt">$</code> for users' shell prompt, + <code class="prompt">%</code> for users' shell prompt, assuming they use the C-shell or tcsh.</p> </div> </div> @@ -1150,13 +1166,13 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2569236">2.1. As + <dt><span class="sect1"><a href="#id2569429">2.1. As tar file</a></span></dt> - <dt><span class="sect1"><a href="#id2569252">2.2. Via + <dt><span class="sect1"><a href="#id2569445">2.2. Via SUP</a></span></dt> - <dt><span class="sect1"><a href="#id2569420">2.3. Via + <dt><span class="sect1"><a href="#id2569477">2.3. Via CVS</a></span></dt> </dl> </dd> @@ -1166,35 +1182,35 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2569530">3.1. + <dt><span class="sect1"><a href="#id2569587">3.1. Bootstrapping pkgsrc</a></span></dt> - <dt><span class="sect1"><a href="#id2569712">3.2. + <dt><span class="sect1"><a href="#id2569768">3.2. Platform specific notes</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2569718">3.2.1. Darwin (Mac OS + "#id2569774">3.2.1. Darwin (Mac OS X)</a></span></dt> <dt><span class="sect2"><a href= - "#id2569880">3.2.2. FreeBSD</a></span></dt> + "#id2569937">3.2.2. FreeBSD</a></span></dt> <dt><span class="sect2"><a href= - "#id2570324">3.2.3. Interix</a></span></dt> + "#id2570449">3.2.3. Interix</a></span></dt> <dt><span class="sect2"><a href= - "#id2570557">3.2.4. IRIX</a></span></dt> + "#id2570750">3.2.4. IRIX</a></span></dt> <dt><span class="sect2"><a href= - "#id2570654">3.2.5. Linux</a></span></dt> + "#id2570848">3.2.5. Linux</a></span></dt> <dt><span class="sect2"><a href= - "#id2570723">3.2.6. OpenBSD</a></span></dt> + "#id2570916">3.2.6. OpenBSD</a></span></dt> <dt><span class="sect2"><a href= - "#id2570835">3.2.7. Solaris</a></span></dt> + "#id2571028">3.2.7. Solaris</a></span></dt> </dl> </dd> </dl> @@ -1212,37 +1228,37 @@ alink="#0000FF"> <dd> <dl> <dt><span class="sect2"><a href= - "#id2571040">4.1.1. Where to get binary + "#id2571164">4.1.1. Where to get binary packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2571080">4.1.2. How to use binary + "#id2571218">4.1.2. How to use binary packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2571256">4.1.3. A word of + "#id2571392">4.1.3. A word of warning</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2571336">4.2. + <dt><span class="sect1"><a href="#id2571949">4.2. Building packages from source</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2571346">4.2.1. Requirements</a></span></dt> + "#id2571960">4.2.1. Requirements</a></span></dt> <dt><span class="sect2"><a href= - "#id2571366">4.2.2. Fetching + "#id2571980">4.2.2. Fetching distfiles</a></span></dt> <dt><span class="sect2"><a href= - "#id2571828">4.2.3. How to build and + "#id2572094">4.2.3. How to build and install</a></span></dt> <dt><span class="sect2"><a href= - "#id2623831">4.2.4. Selecting the + "#id2623825">4.2.4. Selecting the compiler</a></span></dt> </dl> </dd> @@ -1254,10 +1270,10 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2623917">5.1. + <dt><span class="sect1"><a href="#id2623979">5.1. Building a single binary package</a></span></dt> - <dt><span class="sect1"><a href="#id2623995">5.2. + <dt><span class="sect1"><a href="#id2624057">5.2. Settings for creation of binary packages</a></span></dt> @@ -1271,25 +1287,25 @@ alink="#0000FF"> Configuration</a></span></dt> <dt><span class="sect2"><a href= - "#id2624142">5.3.2. Other environmental + "#id2624204">5.3.2. Other environmental considerations</a></span></dt> <dt><span class="sect2"><a href= - "#id2624183">5.3.3. Operation</a></span></dt> + "#id2624245">5.3.3. Operation</a></span></dt> <dt><span class="sect2"><a href= - "#id2624252">5.3.4. What it does</a></span></dt> + "#id2624382">5.3.4. What it does</a></span></dt> <dt><span class="sect2"><a href= - "#id2624309">5.3.5. Disk space + "#id2624439">5.3.5. Disk space requirements</a></span></dt> <dt><span class="sect2"><a href= - "#id2624336">5.3.6. Setting up a sandbox for + "#id2624466">5.3.6. Setting up a sandbox for chroot'ed builds</a></span></dt> <dt><span class="sect2"><a href= - "#id2624865">5.3.7. Building a partial set of + "#id2624926">5.3.7. Building a partial set of packages</a></span></dt> <dt><span class="sect2"><a href= @@ -1298,14 +1314,14 @@ alink="#0000FF"> </dl> </dd> - <dt><span class="sect1"><a href="#id2625321">5.4. + <dt><span class="sect1"><a href="#id2625383">5.4. Creating a multiple CD-ROM packages collection</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2625336">5.4.1. Example of + "#id2625398">5.4.1. Example of cdpack</a></span></dt> </dl> </dd> @@ -1317,52 +1333,52 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2625528">6.1. Are + <dt><span class="sect1"><a href="#id2625590">6.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> - <dt><span class="sect1"><a href="#id2625662">6.2. + <dt><span class="sect1"><a href="#id2625724">6.2. Where's the pkgviews documentation?</a></span></dt> <dt><span class="sect1"><a href="#faq-pkgtools">6.3. Utilities for package management (pkgtools)</a></span></dt> - <dt><span class="sect1"><a href="#id2625984">6.4. How + <dt><span class="sect1"><a href="#id2625987">6.4. How to use pkgsrc as non-root</a></span></dt> - <dt><span class="sect1"><a href="#id2625995">6.5. How + <dt><span class="sect1"><a href="#id2625998">6.5. How to resume transfers when fetching distfiles?</a></span></dt> - <dt><span class="sect1"><a href="#id2626045">6.6. How + <dt><span class="sect1"><a href="#id2626049">6.6. How can I install/use XFree86 from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2626073">6.7. How + <dt><span class="sect1"><a href="#id2626076">6.7. How can I install/use X.org from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2626101">6.8. How + <dt><span class="sect1"><a href="#id2626104">6.8. How to fetch files from behind a firewall</a></span></dt> - <dt><span class="sect1"><a href="#id2626115">6.9. How + <dt><span class="sect1"><a href="#id2626118">6.9. How do I tell <span><strong class="command">make fetch</strong></span> to do passive FTP?</a></span></dt> - <dt><span class="sect1"><a href="#id2626166">6.10. + <dt><span class="sect1"><a href="#id2626169">6.10. How to fetch all distfiles at once</a></span></dt> - <dt><span class="sect1"><a href="#id2626313">6.11. + <dt><span class="sect1"><a href="#id2626453">6.11. What does “<span class="quote">Don't know how to make /usr/share/tmac/tmac.andoc</span>” mean?</a></span></dt> - <dt><span class="sect1"><a href="#id2626352">6.12. + <dt><span class="sect1"><a href="#id2626491">6.12. What does “<span class="quote">Could not find bsd.own.mk</span>” mean?</a></span></dt> - <dt><span class="sect1"><a href="#id2626409">6.13. + <dt><span class="sect1"><a href="#id2626549">6.13. Using 'sudo' with pkgsrc</a></span></dt> <dt><span class="sect1"><a href="#faq.conf">6.14. @@ -1392,13 +1408,13 @@ alink="#0000FF"> <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2569236">2.1. As + <dt><span class="sect1"><a href="#id2569429">2.1. As tar file</a></span></dt> - <dt><span class="sect1"><a href="#id2569252">2.2. Via + <dt><span class="sect1"><a href="#id2569445">2.2. Via SUP</a></span></dt> - <dt><span class="sect1"><a href="#id2569420">2.3. Via + <dt><span class="sect1"><a href="#id2569477">2.3. Via CVS</a></span></dt> </dl> </div> @@ -1412,7 +1428,7 @@ alink="#0000FF"> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2569236" id="id2569236"></a>2.1. As tar + "id2569429" id="id2569429"></a>2.1. As tar file</h2> </div> </div> @@ -1430,7 +1446,7 @@ alink="#0000FF"> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2569252" id="id2569252"></a>2.2. Via + "id2569445" id="id2569445"></a>2.2. Via SUP</h2> </div> </div> @@ -1456,7 +1472,7 @@ release=pkgsrc <div> <div> <h2 class="title" style="clear: both"><a name= - "id2569420" id="id2569420"></a>2.3. Via + "id2569477" id="id2569477"></a>2.3. Via CVS</h2> </div> </div> @@ -1464,9 +1480,8 @@ release=pkgsrc <p>To get pkgsrc via CVS, make sure you have “<span class="quote">cvs</span>” installed. - If not present on your system, it can be found as - precompiled binary on ftp.NetBSD.org. To do an initial - (full) checkout of pkgsrc, do the following steps:</p> + To do an initial (full) checkout of pkgsrc, do the + following steps:</p> <pre class="screen"> <code class="prompt">%</code> <strong class= "userinput"><code>setenv CVSROOT anoncvs@anoncvs.NetBSD.org:/cvsroot</code></strong> @@ -1513,33 +1528,33 @@ release=pkgsrc <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2569530">3.1. + <dt><span class="sect1"><a href="#id2569587">3.1. Bootstrapping pkgsrc</a></span></dt> - <dt><span class="sect1"><a href="#id2569712">3.2. + <dt><span class="sect1"><a href="#id2569768">3.2. Platform specific notes</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2569718">3.2.1. + <dt><span class="sect2"><a href="#id2569774">3.2.1. Darwin (Mac OS X)</a></span></dt> - <dt><span class="sect2"><a href="#id2569880">3.2.2. + <dt><span class="sect2"><a href="#id2569937">3.2.2. FreeBSD</a></span></dt> - <dt><span class="sect2"><a href="#id2570324">3.2.3. + <dt><span class="sect2"><a href="#id2570449">3.2.3. Interix</a></span></dt> - <dt><span class="sect2"><a href="#id2570557">3.2.4. + <dt><span class="sect2"><a href="#id2570750">3.2.4. IRIX</a></span></dt> - <dt><span class="sect2"><a href="#id2570654">3.2.5. + <dt><span class="sect2"><a href="#id2570848">3.2.5. Linux</a></span></dt> - <dt><span class="sect2"><a href="#id2570723">3.2.6. + <dt><span class="sect2"><a href="#id2570916">3.2.6. OpenBSD</a></span></dt> - <dt><span class="sect2"><a href="#id2570835">3.2.7. + <dt><span class="sect2"><a href="#id2571028">3.2.7. Solaris</a></span></dt> </dl> </dd> @@ -1551,13 +1566,13 @@ release=pkgsrc <div> <div> <h2 class="title" style="clear: both"><a name= - "id2569530" id= - "id2569530"></a>3.1. Bootstrapping pkgsrc</h2> + "id2569587" id= + "id2569587"></a>3.1. Bootstrapping pkgsrc</h2> </div> </div> </div> - <p>For Operating Systems other than NetBSD, we provide a + <p>For operating systems other than NetBSD, we provide a bootstrap kit to build the required tools to use pkgsrc on your platform. Besides support for native NetBSD, pkgsrc and the bootstrap kit have support for the @@ -1626,9 +1641,9 @@ release=pkgsrc "emphasis"><em>prefix</em></span> where programs will be installed in, and <code class= "filename">/var/db/pkg</code> for the package database - directory where pkgsrc will do it's internal bookkeeping. + directory where pkgsrc will do its internal bookkeeping. However, these can also be set using command-line - parameters.</p> + arguments.</p> <p>Binary packages for the pkgsrc tools and an initial set of packages is available for supported platforms. An @@ -1642,7 +1657,7 @@ release=pkgsrc <div> <div> <h2 class="title" style="clear: both"><a name= - "id2569712" id="id2569712"></a>3.2. Platform + "id2569768" id="id2569768"></a>3.2. Platform specific notes</h2> </div> </div> @@ -1655,8 +1670,8 @@ release=pkgsrc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2569718" id= - "id2569718"></a>3.2.1. Darwin (Mac OS + <h3 class="title"><a name="id2569774" id= + "id2569774"></a>3.2.1. Darwin (Mac OS X)</h3> </div> </div> @@ -1788,8 +1803,8 @@ release=pkgsrc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2569880" id= - "id2569880"></a>3.2.2. FreeBSD</h3> + <h3 class="title"><a name="id2569937" id= + "id2569937"></a>3.2.2. FreeBSD</h3> </div> </div> </div> @@ -1845,8 +1860,8 @@ release=pkgsrc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2570324" id= - "id2570324"></a>3.2.3. Interix</h3> + <h3 class="title"><a name="id2570449" id= + "id2570449"></a>3.2.3. Interix</h3> </div> </div> </div> @@ -2027,8 +2042,8 @@ interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi: <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2570557" id= - "id2570557"></a>3.2.4. IRIX</h3> + <h3 class="title"><a name="id2570750" id= + "id2570750"></a>3.2.4. IRIX</h3> </div> </div> </div> @@ -2054,11 +2069,11 @@ interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi: "refentrytitle">if_nametoindex</span>(3)</span></a>, etc.</p> - <p>At this point in time, pkgsrc only supports one ABI. - That is, you can not switch between the old 32-bit ABI, - the new 32-bit ABI and the 64-bit ABI. If you start out - using "abi=n32", that's what all your packages will be - built with.</p> + <p>At this point in time, pkgsrc only supports one ABI + at a time. That is, you can not switch between the old + 32-bit ABI, the new 32-bit ABI and the 64-bit ABI. If + you start out using "abi=n32", that's what all your + packages will be built with.</p> <p>Therefore, please make sure that you have no conflicting <code class="varname">CFLAGS</code> in your @@ -2080,7 +2095,7 @@ interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi: to set some options depending on your local setup. Please see <code class= "filename">pkgsrc/mk/defaults/mk.conf</code> and, of - course, your compilers man pages for details.</p> + course, your compiler's man pages for details.</p> <p>If you are using SGI's MIPSPro compiler, please set</p> @@ -2108,8 +2123,8 @@ PKGSRC_COMPILER=mipspro <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2570654" id= - "id2570654"></a>3.2.5. Linux</h3> + <h3 class="title"><a name="id2570848" id= + "id2570848"></a>3.2.5. Linux</h3> </div> </div> </div> @@ -2186,8 +2201,8 @@ ICCBASE=/opt/icc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2570723" id= - "id2570723"></a>3.2.6. OpenBSD</h3> + <h3 class="title"><a name="id2570916" id= + "id2570916"></a>3.2.6. OpenBSD</h3> </div> </div> </div> @@ -2253,8 +2268,8 @@ ICCBASE=/opt/icc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2570835" id= - "id2570835"></a>3.2.7. Solaris</h3> + <h3 class="title"><a name="id2571028" id= + "id2571028"></a>3.2.7. Solaris</h3> </div> </div> </div> @@ -2298,8 +2313,8 @@ ICCBASE=/opt/icc <div class="titlepage"> <div> <div> - <h4 class="title"><a name="id2570934" id= - "id2570934"></a>3.2.7.1. If you are using + <h4 class="title"><a name="id2571059" id= + "id2571059"></a>3.2.7.1. If you are using gcc</h4> </div> </div> @@ -2328,8 +2343,8 @@ ICCBASE=/opt/icc <div class="titlepage"> <div> <div> - <h4 class="title"><a name="id2570955" id= - "id2570955"></a>3.2.7.2. If you are using + <h4 class="title"><a name="id2571080" id= + "id2571080"></a>3.2.7.2. If you are using Sun WorkShop</h4> </div> </div> @@ -2365,7 +2380,7 @@ ICCBASE=/opt/icc <code class="varname">CPP</code> in <code class= "filename">/etc/mk.conf</code>, eg.</p> <pre class="programlisting"> -CC= cc +CC= cc CXX= CC CPP= /usr/ccs/lib/cpp </pre> @@ -2406,32 +2421,32 @@ CFLAGS= -xtarget=ultra -xarch=v9 <dd> <dl> - <dt><span class="sect2"><a href="#id2571040">4.1.1. + <dt><span class="sect2"><a href="#id2571164">4.1.1. Where to get binary packages</a></span></dt> - <dt><span class="sect2"><a href="#id2571080">4.1.2. + <dt><span class="sect2"><a href="#id2571218">4.1.2. How to use binary packages</a></span></dt> - <dt><span class="sect2"><a href="#id2571256">4.1.3. + <dt><span class="sect2"><a href="#id2571392">4.1.3. A word of warning</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2571336">4.2. + <dt><span class="sect1"><a href="#id2571949">4.2. Building packages from source</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2571346">4.2.1. + <dt><span class="sect2"><a href="#id2571960">4.2.1. Requirements</a></span></dt> - <dt><span class="sect2"><a href="#id2571366">4.2.2. + <dt><span class="sect2"><a href="#id2571980">4.2.2. Fetching distfiles</a></span></dt> - <dt><span class="sect2"><a href="#id2571828">4.2.3. + <dt><span class="sect2"><a href="#id2572094">4.2.3. How to build and install</a></span></dt> - <dt><span class="sect2"><a href="#id2623831">4.2.4. + <dt><span class="sect2"><a href="#id2623825">4.2.4. Selecting the compiler</a></span></dt> </dl> </dd> @@ -2458,8 +2473,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571040" id= - "id2571040"></a>4.1.1. Where to get binary + <h3 class="title"><a name="id2571164" id= + "id2571164"></a>4.1.1. Where to get binary packages</h3> </div> </div> @@ -2467,16 +2482,19 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>Precompiled packages are stored on ftp.NetBSD.org and its mirrors in the directory <code class= - "filename">/pub/NetBSD/packages</code> for anonymous - FTP access. Please pick the right subdirectory there as - indicated by <span><strong class="command">uname - -p</strong></span>. In that directory, there is a - subdirectory for each category plus a subdirectory - <code class="filename">All</code> which includes the - actual binaries in <code class="filename">.tgz</code> - files. The category subdirectories use symbolic links - to those files (this is the same directory layout as in - <code class= + "filename">/pub/NetBSD/packages/<OSVERSION>/<ARCH>/</code> + for anonymous FTP access. <code class= + "varname">OSVERSION</code> is the NetBSD version + (<span><strong class="command">uname + -r</strong></span>), <code class="varname">ARCH</code> + is the architecture (<span><strong class= + "command">uname -p</strong></span>). In that directory, + there is a subdirectory for each category plus a + subdirectory <code class="filename">All</code> which + includes the actual binaries in <code class= + "filename">.tgz</code> files. The category + subdirectories use symbolic links to those files (this + is the same directory layout as in <code class= "filename">/usr/pkgsrc/packages</code>).</p> <p>This same directory layout applies for CDROM @@ -2490,8 +2508,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571080" id= - "id2571080"></a>4.1.2. How to use binary + <h3 class="title"><a name="id2571218" id= + "id2571218"></a>4.1.2. How to use binary packages</h3> </div> </div> @@ -2499,7 +2517,7 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>If you have the files on a CDROM or downloaded them to your hard disk, you can install them with the - following command (be sure to<span><strong class= + following command (be sure to <span><strong class= "command">su</strong></span> to root first):</p> <pre class="screen"> <code class="prompt">#</code> <strong class= @@ -2513,16 +2531,11 @@ CFLAGS= -xtarget=ultra -xarch=v9 an FTP URL:</p> <pre class="screen"> <code class="prompt">#</code> <strong class= -"userinput"><code>pkg_add ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSvers>/<arch>/All/package.tgz</code></strong> +"userinput"><code>pkg_add ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/All/package.tgz</code></strong> </pre> - <p>If there is any doubt, the uname utility can be used - to determine the <OSvers>, and <arch> by - running <span><strong class="command">uname - -rp</strong></span>.</p> - - <p>Also note that any prerequisite packages needed to - run the package in question will be installed, too, + <p>Note that any prerequisite packages needed to run + the package in question will be installed, too, assuming they are present where you install from.</p> <p>To save some typing, you can set the <code class= @@ -2546,13 +2559,14 @@ CFLAGS= -xtarget=ultra -xarch=v9 verify that the vulnerabilities are acceptable for your configuration. An example <code class= "varname">PKG_PATH</code> would be: <code class= - "filename">ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSvers>/<arch>/All;ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSvers>/<arch>/vulnerable</code> + "filename">ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/All;ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/vulnerable</code> Please note that semicolon (';') is a shell meta-character, so you'll probably have to quote it.</p> <p>After you've installed packages, be sure to have - <code class="filename">/usr/pkg/bin</code> in your + <code class="filename">/usr/pkg/bin</code> and + <code class="filename">/usr/pkg/sbin</code> in your <code class="varname">PATH</code> so you can actually start the just installed program.</p> </div> @@ -2561,8 +2575,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571256" id= - "id2571256"></a>4.1.3. A word of + <h3 class="title"><a name="id2571392" id= + "id2571392"></a>4.1.3. A word of warning</h3> </div> </div> @@ -2585,7 +2599,7 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2571336" id="id2571336"></a>4.2. Building + "id2571949" id="id2571949"></a>4.2. Building packages from source</h2> </div> </div> @@ -2594,14 +2608,15 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>This assumes that the package is already in pkgsrc. If it is not, see <a href="#developers-guide" title= "Part II. The pkgsrc developer's guide">Part II, - “The pkgsrc developer's guide”</a>.</p> + “The pkgsrc developer's guide”</a> for + instructions how to create your own packages.</p> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571346" id= - "id2571346"></a>4.2.1. Requirements</h3> + <h3 class="title"><a name="id2571960" id= + "id2571960"></a>4.2.1. Requirements</h3> </div> </div> </div> @@ -2620,26 +2635,23 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571366" id= - "id2571366"></a>4.2.2. Fetching + <h3 class="title"><a name="id2571980" id= + "id2571980"></a>4.2.2. Fetching distfiles</h3> </div> </div> </div> - <p>The distfile (i.e. the unmodified source) must exist - on your system for the packages system to be able to - build it. If it does not exist, pkgsrc will use - <a href="http://netbsd.gw.com/cgi-bin/man-cgi?ftp+1+NetBSD-current"> - <span class="citerefentry"><span class= - "refentrytitle">ftp</span>(1)</span></a> to fetch it + <p>The first step for building a package is downloading + the distfiles (i.e. the unmodified source). If they + have not yet been downloaded, pkgsrc will fetch them automatically.</p> <p>You can overwrite some of the major distribution sites to fit to sites that are close to your own. Have a look at <code class= "filename">pkgsrc/mk/defaults/mk.conf</code> to find - some examples - in particular, look for the + some examples — in particular, look for the <code class="varname">MASTER_SORT</code>, <code class= "varname">MASTER_SORT_REGEX</code> and <code class= "varname">INET_COUNTRY</code> definitions. This may @@ -2662,8 +2674,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571828" id= - "id2571828"></a>4.2.3. How to build and + <h3 class="title"><a name="id2572094" id= + "id2572094"></a>4.2.3. How to build and install</h3> </div> </div> @@ -2831,8 +2843,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2623831" id= - "id2623831"></a>4.2.4. Selecting the + <h3 class="title"><a name="id2623825" id= + "id2623825"></a>4.2.4. Selecting the compiler</h3> </div> </div> @@ -2932,10 +2944,10 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2623917">5.1. + <dt><span class="sect1"><a href="#id2623979">5.1. Building a single binary package</a></span></dt> - <dt><span class="sect1"><a href="#id2623995">5.2. + <dt><span class="sect1"><a href="#id2624057">5.2. Settings for creation of binary packages</a></span></dt> @@ -2948,23 +2960,23 @@ CFLAGS= -xtarget=ultra -xarch=v9 "#binary.configuration">5.3.1. Configuration</a></span></dt> - <dt><span class="sect2"><a href="#id2624142">5.3.2. + <dt><span class="sect2"><a href="#id2624204">5.3.2. Other environmental considerations</a></span></dt> - <dt><span class="sect2"><a href="#id2624183">5.3.3. + <dt><span class="sect2"><a href="#id2624245">5.3.3. Operation</a></span></dt> - <dt><span class="sect2"><a href="#id2624252">5.3.4. + <dt><span class="sect2"><a href="#id2624382">5.3.4. What it does</a></span></dt> - <dt><span class="sect2"><a href="#id2624309">5.3.5. + <dt><span class="sect2"><a href="#id2624439">5.3.5. Disk space requirements</a></span></dt> - <dt><span class="sect2"><a href="#id2624336">5.3.6. + <dt><span class="sect2"><a href="#id2624466">5.3.6. Setting up a sandbox for chroot'ed builds</a></span></dt> - <dt><span class="sect2"><a href="#id2624865">5.3.7. + <dt><span class="sect2"><a href="#id2624926">5.3.7. Building a partial set of packages</a></span></dt> <dt><span class="sect2"><a href= @@ -2973,13 +2985,13 @@ CFLAGS= -xtarget=ultra -xarch=v9 </dl> </dd> - <dt><span class="sect1"><a href="#id2625321">5.4. + <dt><span class="sect1"><a href="#id2625383">5.4. Creating a multiple CD-ROM packages collection</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2625336">5.4.1. + <dt><span class="sect2"><a href="#id2625398">5.4.1. Example of cdpack</a></span></dt> </dl> </dd> @@ -2991,7 +3003,7 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2623917" id="id2623917"></a>5.1. Building a + "id2623979" id="id2623979"></a>5.1. Building a single binary package</h2> </div> </div> @@ -3045,7 +3057,7 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2623995" id="id2623995"></a>5.2. Settings + "id2624057" id="id2624057"></a>5.2. Settings for creation of binary packages</h2> </div> </div> @@ -3127,8 +3139,8 @@ _ACCEPTABLE= yes <div class="titlepage"> <div> <div> - <h4 class="title"><a name="id2624060" id= - "id2624060"></a>5.3.1.2. <code class= + <h4 class="title"><a name="id2624122" id= + "id2624122"></a>5.3.1.2. <code class= "filename">build.conf</code></h4> </div> </div> @@ -3153,8 +3165,8 @@ _ACCEPTABLE= yes <div class="titlepage"> <div> <div> - <h4 class="title"><a name="id2624097" id= - "id2624097"></a>5.3.1.3. <code class= + <h4 class="title"><a name="id2624158" id= + "id2624158"></a>5.3.1.3. <code class= "filename">pre-build.local</code></h4> </div> </div> @@ -3188,8 +3200,8 @@ _ACCEPTABLE= yes <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2624142" id= - "id2624142"></a>5.3.2. Other environmental + <h3 class="title"><a name="id2624204" id= + "id2624204"></a>5.3.2. Other environmental considerations</h3> </div> </div> @@ -3230,8 +3242,8 @@ fi <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2624183" id= - "id2624183"></a>5.3.3. Operation</h3> + <h3 class="title"><a name="id2624245" id= + "id2624245"></a>5.3.3. Operation</h3> </div> </div> </div> @@ -3277,8 +3289,8 @@ fi <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2624252" id= - "id2624252"></a>5.3.4. What it does</h3> + <h3 class="title"><a name="id2624382" id= + "id2624382"></a>5.3.4. What it does</h3> </div> </div> </div> @@ -3336,8 +3348,8 @@ fi <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2624309" id= - "id2624309"></a>5.3.5. Disk space + <h3 class="title"><a name="id2624439" id= + "id2624439"></a>5.3.5. Disk space requirements</h3> </div> </div> @@ -3379,8 +3391,8 @@ fi <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2624336" id= - "id2624336"></a>5.3.6. Setting up a sandbox + <h3 class="title"><a name="id2624466" id= + "id2624466"></a>5.3.6. Setting up a sandbox for chroot'ed builds</h3> </div> </div> @@ -3569,8 +3581,8 @@ fi <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2624865" id= - "id2624865"></a>5.3.7. Building a partial + <h3 class="title"><a name="id2624926" id= + "id2624926"></a>5.3.7. Building a partial set of packages</h3> </div> </div> @@ -3763,7 +3775,7 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2625321" id="id2625321"></a>5.4. Creating a + "id2625383" id="id2625383"></a>5.4. Creating a multiple CD-ROM packages collection</h2> </div> </div> @@ -3786,8 +3798,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2625336" id= - "id2625336"></a>5.4.1. Example of + <h3 class="title"><a name="id2625398" id= + "id2625398"></a>5.4.1. Example of cdpack</h3> </div> </div> @@ -3860,51 +3872,51 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2625528">6.1. Are + <dt><span class="sect1"><a href="#id2625590">6.1. Are there any mailing lists for pkg-related discussion?</a></span></dt> - <dt><span class="sect1"><a href="#id2625662">6.2. + <dt><span class="sect1"><a href="#id2625724">6.2. Where's the pkgviews documentation?</a></span></dt> <dt><span class="sect1"><a href="#faq-pkgtools">6.3. Utilities for package management (pkgtools)</a></span></dt> - <dt><span class="sect1"><a href="#id2625984">6.4. How + <dt><span class="sect1"><a href="#id2625987">6.4. How to use pkgsrc as non-root</a></span></dt> - <dt><span class="sect1"><a href="#id2625995">6.5. How + <dt><span class="sect1"><a href="#id2625998">6.5. How to resume transfers when fetching distfiles?</a></span></dt> - <dt><span class="sect1"><a href="#id2626045">6.6. How + <dt><span class="sect1"><a href="#id2626049">6.6. How can I install/use XFree86 from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2626073">6.7. How + <dt><span class="sect1"><a href="#id2626076">6.7. How can I install/use X.org from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2626101">6.8. How + <dt><span class="sect1"><a href="#id2626104">6.8. How to fetch files from behind a firewall</a></span></dt> - <dt><span class="sect1"><a href="#id2626115">6.9. How + <dt><span class="sect1"><a href="#id2626118">6.9. How do I tell <span><strong class="command">make fetch</strong></span> to do passive FTP?</a></span></dt> - <dt><span class="sect1"><a href="#id2626166">6.10. How + <dt><span class="sect1"><a href="#id2626169">6.10. How to fetch all distfiles at once</a></span></dt> - <dt><span class="sect1"><a href="#id2626313">6.11. What + <dt><span class="sect1"><a href="#id2626453">6.11. What does “<span class="quote">Don't know how to make /usr/share/tmac/tmac.andoc</span>” mean?</a></span></dt> - <dt><span class="sect1"><a href="#id2626352">6.12. What + <dt><span class="sect1"><a href="#id2626491">6.12. What does “<span class="quote">Could not find bsd.own.mk</span>” mean?</a></span></dt> - <dt><span class="sect1"><a href="#id2626409">6.13. + <dt><span class="sect1"><a href="#id2626549">6.13. Using 'sudo' with pkgsrc</a></span></dt> <dt><span class="sect1"><a href="#faq.conf">6.14. @@ -3926,7 +3938,7 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2625528" id="id2625528"></a>6.1. Are there + "id2625590" id="id2625590"></a>6.1. Are there any mailing lists for pkg-related discussion?</h2> </div> </div> @@ -3985,7 +3997,7 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2625662" id="id2625662"></a>6.2. Where's + "id2625724" id="id2625724"></a>6.2. Where's the pkgviews documentation?</h2> </div> </div> @@ -4040,15 +4052,15 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/digest/README.html" class="pkgname">pkgtools/digest</a>: calculates - SHA1 checksums (and other kinds)</p> + various kinds of checksums (including SHA1)</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/libnbcompat/README.html" - class="pkgname">pkgtools/libnbcompat</a>: compat - library for pkg tools</p> + class="pkgname">pkgtools/libnbcompat</a>: + compatibility library for pkgsrc tools</p> </li> <li> @@ -4082,7 +4094,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_tarup/README.html" class="pkgname">pkgtools/pkg_tarup</a>: create a binary package from an already-installed package. - used by 'make replace' to save the old package</p> + used by <span><strong class="command">make + replace</strong></span> to save the old package</p> </li> <li> @@ -4124,9 +4137,9 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_chk/README.html" - class="pkgname">pkgtools/pkg_chk</a>: installs - pkg_chk, which reports on packages whose installed - versions do not match the latest pkgsrc entries</p> + class="pkgname">pkgtools/pkg_chk</a>: reports on + packages whose installed versions do not match the + latest pkgsrc entries</p> </li> <li> @@ -4142,19 +4155,22 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdepgraph/README.html" - class="pkgname">pkgtools/pkgdepgraph</a>: make - graph from above (uses graphviz)</p> + class="pkgname">pkgtools/pkgdepgraph</a>: makes + graphs from the output of <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdep/README.html" + class="pkgname">pkgtools/pkgdep</a> (uses + graphviz)</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkglint/README.html" - class="pkgname">pkgtools/pkglint</a>: This provides - two distinct abilities: check a pkgsrc entry for - correctness (pkglint) check for and remove - out-of-date distfiles and binary packages - (lintpkgsrc)</p> + class="pkgname">pkgtools/pkglint</a>: the + pkglint(1) program checks a pkgsrc entry for + errors, lintpkgsrc(1) does various checks on the + complete pkgsrc system.</p> </li> <li> @@ -4240,7 +4256,7 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2625984" id="id2625984"></a>6.4. How to use + "id2625987" id="id2625987"></a>6.4. How to use pkgsrc as non-root</h2> </div> </div> @@ -4258,7 +4274,7 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2625995" id="id2625995"></a>6.5. How to + "id2625998" id="id2625998"></a>6.5. How to resume transfers when fetching distfiles?</h2> </div> </div> @@ -4287,11 +4303,9 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> to use something like:</p> <pre class="programlisting"> FETCH_CMD=wget - .if defined(FETCH_CMD) && ${FETCH_CMD} == "wget" FETCH_BEFORE_ARGS=--passive-ftp FETCH_RESUME_ARGS=-c FETCH_OUTPUT_ARGS=-O - .endif </pre> </div> @@ -4301,7 +4315,7 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2626045" id="id2626045"></a>6.6. How can I + "id2626049" id="id2626049"></a>6.6. How can I install/use XFree86 from pkgsrc?</h2> </div> </div> @@ -4324,7 +4338,7 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2626073" id="id2626073"></a>6.7. How can I + "id2626076" id="id2626076"></a>6.7. How can I install/use X.org from pkgsrc?</h2> </div> </div> @@ -4347,7 +4361,7 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2626101" id="id2626101"></a>6.8. How to + "id2626104" id="id2626104"></a>6.8. How to fetch files from behind a firewall</h2> </div> </div> @@ -4372,7 +4386,7 @@ http_proxy=http://orpheus.amdahl.com:80/ <div> <div> <h2 class="title" style="clear: both"><a name= - "id2626115" id="id2626115"></a>6.9. How do I + "id2626118" id="id2626118"></a>6.9. How do I tell <span><strong class="command">make fetch</strong></span> to do passive FTP?</h2> </div> @@ -4406,7 +4420,7 @@ ${LOCALBASE}/bin/ftp <div> <div> <h2 class="title" style="clear: both"><a name= - "id2626166" id="id2626166"></a>6.10. How to + "id2626169" id="id2626169"></a>6.10. How to fetch all distfiles at once</h2> </div> </div> @@ -4479,7 +4493,7 @@ ${LOCALBASE}/bin/ftp <div> <div> <h2 class="title" style="clear: both"><a name= - "id2626313" id="id2626313"></a>6.11. What does + "id2626453" id="id2626453"></a>6.11. What does “<span class="quote">Don't know how to make /usr/share/tmac/tmac.andoc</span>” mean?</h2> </div> @@ -4511,7 +4525,7 @@ ${LOCALBASE}/bin/ftp <div> <div> <h2 class="title" style="clear: both"><a name= - "id2626352" id="id2626352"></a>6.12. What does + "id2626491" id="id2626491"></a>6.12. What does “<span class="quote">Could not find bsd.own.mk</span>” mean?</h2> </div> @@ -4540,7 +4554,7 @@ ${LOCALBASE}/bin/ftp <div> <div> <h2 class="title" style="clear: both"><a name= - "id2626409" id="id2626409"></a>6.13. Using + "id2626549" id="id2626549"></a>6.13. Using 'sudo' with pkgsrc</h2> </div> </div> @@ -4788,66 +4802,82 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <p><b>Table of Contents</b></p> <dl> - <dt><span class="chapter"><a href="#makefile">7. + <dt><span class="chapter"><a href="#components">7. + Package components - files, directories and + contents</a></span></dt> + + <dd> + <dl> + <dt><span class="sect1"><a href= + "#components.Makefile">7.1. <code class= + "filename">Makefile</code></a></span></dt> + + <dt><span class="sect1"><a href= + "#components.distinfo">7.2. <code class= + "filename">distinfo</code></a></span></dt> + + <dt><span class="sect1"><a href= + "#components.patches">7.3. patches/*</a></span></dt> + + <dt><span class="sect1"><a href="#id2627632">7.4. + Other mandatory files</a></span></dt> + + <dt><span class="sect1"><a href= + "#components.optional">7.5. Optional + files</a></span></dt> + + <dt><span class="sect1"><a href="#id2627757">7.6. + <code class="filename">work*</code></a></span></dt> + + <dt><span class="sect1"><a href="#id2627845">7.7. + <code class="filename">files/*</code></a></span></dt> + </dl> + </dd> + + <dt><span class="chapter"><a href="#makefile">8. Programming in <code class= "filename">Makefile</code>s</a></span></dt> <dd> <dl> <dt><span class="sect1"><a href= - "#makefile.variables">7.1. <code class= + "#makefile.variables">8.1. <code class= "filename">Makefile</code> variables</a></span></dt> - <dt><span class="sect1"><a href="#makefile.code">7.2. + <dd> + <dl> + <dt><span class="sect2"><a href= + "#makefile.variables.names">8.1.1. Naming + conventions</a></span></dt> + </dl> + </dd> + + <dt><span class="sect1"><a href="#makefile.code">8.2. Code snippets</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2627035">7.2.1. Adding things to a + "#id2628274">8.2.1. Adding things to a list</a></span></dt> <dt><span class="sect2"><a href= - "#id2627113">7.2.2. Converting an internal list + "#id2628283">8.2.2. Converting an internal list into an external list</a></span></dt> <dt><span class="sect2"><a href= - "#id2627131">7.2.3. Passing variables to a shell + "#id2628305">8.2.3. Passing variables to a shell command</a></span></dt> - </dl> - </dd> - </dl> - </dd> - - <dt><span class="chapter"><a href="#components">8. - Package components - files, directories and - contents</a></span></dt> - - <dd> - <dl> - <dt><span class="sect1"><a href= - "#components.Makefile">8.1. <code class= - "filename">Makefile</code></a></span></dt> - - <dt><span class="sect1"><a href= - "#components.distinfo">8.2. <code class= - "filename">distinfo</code></a></span></dt> - - <dt><span class="sect1"><a href= - "#components.patches">8.3. patches/*</a></span></dt> - - <dt><span class="sect1"><a href="#id2627827">8.4. - Other mandatory files</a></span></dt> - <dt><span class="sect1"><a href= - "#components.optional">8.5. Optional - files</a></span></dt> - - <dt><span class="sect1"><a href="#id2628089">8.6. - <code class="filename">work*</code></a></span></dt> + <dt><span class="sect2"><a href= + "#id2628426">8.2.4. Quoting + guideline</a></span></dt> - <dt><span class="sect1"><a href="#id2628177">8.7. - <code class="filename">files/*</code></a></span></dt> + <dt><span class="sect2"><a href= + "#id2628677">8.2.5. Workaround for a bug in BSD + Make</a></span></dt> + </dl> + </dd> </dl> </dd> @@ -4856,10 +4886,10 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <dd> <dl> - <dt><span class="sect1"><a href="#id2628231">9.1. RCS + <dt><span class="sect1"><a href="#id2628738">9.1. RCS ID</a></span></dt> - <dt><span class="sect1"><a href="#id2628246">9.2. + <dt><span class="sect1"><a href="#id2628753">9.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> @@ -4870,14 +4900,14 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <dt><span class="sect1"><a href="#plist.misc">9.4. Variable substitution in PLIST</a></span></dt> - <dt><span class="sect1"><a href="#id2628499">9.5. + <dt><span class="sect1"><a href="#id2629074">9.5. Manpage-compression</a></span></dt> - <dt><span class="sect1"><a href="#id2628609">9.6. + <dt><span class="sect1"><a href="#id2629115">9.6. Changing PLIST source with <code class= "varname">PLIST_SRC</code></a></span></dt> - <dt><span class="sect1"><a href="#id2628633">9.7. + <dt><span class="sect1"><a href="#id2629140">9.7. Platform specific and differing PLISTs</a></span></dt> @@ -4892,21 +4922,21 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <dd> <dl> - <dt><span class="sect1"><a href="#id2628968">10.1. + <dt><span class="sect1"><a href="#id2629406">10.1. Converting packages to use buildlink3</a></span></dt> - <dt><span class="sect1"><a href="#id2629149">10.2. + <dt><span class="sect1"><a href="#id2629724">10.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2629219">10.2.1. Anatomy of a buildlink3.mk + "#id2629794">10.2.1. Anatomy of a buildlink3.mk file</a></span></dt> <dt><span class="sect2"><a href= - "#id2629796">10.2.2. Updating <code class= + "#id2630166">10.2.2. Updating <code class= "varname">BUILDLINK_DEPENDS.<em class= "replaceable"><code>pkg</code></em></code> in <code class="filename">buildlink3.mk</code> @@ -4914,18 +4944,18 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc </dl> </dd> - <dt><span class="sect1"><a href="#id2629943">10.3. + <dt><span class="sect1"><a href="#id2630245">10.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2630024">10.3.1. Anatomy of a <code class= + "#id2630394">10.3.1. Anatomy of a <code class= "filename">builtin.mk</code> file</a></span></dt> <dt><span class="sect2"><a href= - "#id2630183">10.3.2. Global preferences for + "#id2630621">10.3.2. Global preferences for native or pkgsrc software</a></span></dt> </dl> </dd> @@ -4937,10 +4967,10 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <dd> <dl> - <dt><span class="sect1"><a href="#id2630256">11.1. + <dt><span class="sect1"><a href="#id2630762">11.1. Global default options</a></span></dt> - <dt><span class="sect1"><a href="#id2630270">11.2. + <dt><span class="sect1"><a href="#id2630777">11.2. Converting packages to use <code class= "filename">bsd.options.mk</code></a></span></dt> </dl> @@ -4954,7 +4984,7 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <dt><span class="sect1"><a href="#build.prefix">12.1. Program location</a></span></dt> - <dt><span class="sect1"><a href="#id2631098">12.2. + <dt><span class="sect1"><a href="#id2631337">12.2. Main targets</a></span></dt> <dt><span class="sect1"><a href= @@ -4968,17 +4998,17 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <dd> <dl> - <dt><span class="sect1"><a href="#id2632458">13.1. + <dt><span class="sect1"><a href="#id2632834">13.1. General operation</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2632461">13.1.1. How to pull in variables + "#id2632837">13.1.1. How to pull in variables from /etc/mk.conf</a></span></dt> <dt><span class="sect2"><a href= - "#id2632545">13.1.2. Restricted + "#id2632920">13.1.2. Restricted packages</a></span></dt> <dt><span class="sect2"><a href= @@ -4986,15 +5016,15 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc dependencies</a></span></dt> <dt><span class="sect2"><a href= - "#id2633066">13.1.4. Handling conflicts with + "#id2633373">13.1.4. Handling conflicts with other packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2633116">13.1.5. Packages that cannot or + "#id2633492">13.1.5. Packages that cannot or should not be built</a></span></dt> <dt><span class="sect2"><a href= - "#id2633142">13.1.6. Packages which should not be + "#id2633517">13.1.6. Packages which should not be deleted, once installed</a></span></dt> <dt><span class="sect2"><a href= @@ -5002,37 +5032,37 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc with security problems</a></span></dt> <dt><span class="sect2"><a href= - "#id2633234">13.1.8. How to handle compiler + "#id2633677">13.1.8. How to handle compiler bugs</a></span></dt> <dt><span class="sect2"><a href= - "#id2633324">13.1.9. How to handle incrementing + "#id2633700">13.1.9. How to handle incrementing versions when fixing an existing package</a></span></dt> <dt><span class="sect2"><a href= - "#id2633373">13.1.10. Portability of + "#id2633817">13.1.10. Portability of packages</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2633398">13.2. + <dt><span class="sect1"><a href="#id2633842">13.2. Possible downloading issues</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2633401">13.2.1. Packages whose distfiles + "#id2633845">13.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt> <dt><span class="sect2"><a href= - "#id2633601">13.2.2. How to handle modified + "#id2633908">13.2.2. How to handle modified distfiles with the 'old' name</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2633612">13.3. + <dt><span class="sect1"><a href="#id2633920">13.3. Configuration gotchas</a></span></dt> <dd> @@ -5042,65 +5072,65 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2633978">13.3.2. Using libtool on GNU + "#id2634285">13.3.2. Using libtool on GNU packages that already support libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2634059">13.3.3. GNU + "#id2634503">13.3.3. GNU Autoconf/Automake</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2634104">13.4. + <dt><span class="sect1"><a href="#id2634616">13.4. Building considerations</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2634107">13.4.1. CPP defines</a></span></dt> + "#id2634619">13.4.1. CPP defines</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2634137">13.5. + <dt><span class="sect1"><a href="#id2634649">13.5. Package specific actions</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2634140">13.5.1. Package configuration + "#id2634652">13.5.1. Package configuration files</a></span></dt> <dt><span class="sect2"><a href= - "#id2634311">13.5.2. User + "#id2634755">13.5.2. User interaction</a></span></dt> <dt><span class="sect2"><a href= - "#id2634492">13.5.3. Handling + "#id2634800">13.5.3. Handling licenses</a></span></dt> <dt><span class="sect2"><a href= - "#id2634644">13.5.4. Creating an account from a + "#id2634951">13.5.4. Creating an account from a package</a></span></dt> <dt><span class="sect2"><a href= - "#id2634706">13.5.5. Installing score + "#id2635013">13.5.5. Installing score files</a></span></dt> <dt><span class="sect2"><a href= - "#id2634749">13.5.6. Packages providing login + "#id2635057">13.5.6. Packages providing login shells</a></span></dt> <dt><span class="sect2"><a href= - "#id2634807">13.5.7. Packages containing perl + "#id2635114">13.5.7. Packages containing perl scripts</a></span></dt> <dt><span class="sect2"><a href= - "#id2634825">13.5.8. Packages with hardcoded + "#id2635132">13.5.8. Packages with hardcoded paths to other interpreters</a></span></dt> <dt><span class="sect2"><a href= - "#id2634846">13.5.9. Packages installing perl + "#id2635154">13.5.9. Packages installing perl modules</a></span></dt> <dt><span class="sect2"><a href= @@ -5108,40 +5138,40 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc info files</a></span></dt> <dt><span class="sect2"><a href= - "#id2635134">13.5.11. Packages installing GConf2 + "#id2635510">13.5.11. Packages installing GConf2 data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2635303">13.5.12. Packages installing + "#id2635678">13.5.12. Packages installing scrollkeeper data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2635354">13.5.13. Packages installing X11 + "#id2635730">13.5.13. Packages installing X11 fonts</a></span></dt> <dt><span class="sect2"><a href= - "#id2635469">13.5.14. Packages installing GTK2 + "#id2635777">13.5.14. Packages installing GTK2 modules</a></span></dt> <dt><span class="sect2"><a href= - "#id2635539">13.5.15. Packages installing SGML or + "#id2635846">13.5.15. Packages installing SGML or XML data</a></span></dt> <dt><span class="sect2"><a href= - "#id2635659">13.5.16. Packages installing + "#id2635898">13.5.16. Packages installing extensions to the MIME database</a></span></dt> <dt><span class="sect2"><a href= - "#id2635730">13.5.17. Packages using + "#id2636037">13.5.17. Packages using intltool</a></span></dt> <dt><span class="sect2"><a href= - "#id2635744">13.5.18. Packages installing startup + "#id2636051">13.5.18. Packages installing startup scripts</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2635765">13.6. + <dt><span class="sect1"><a href="#id2636072">13.6. Feedback to the author</a></span></dt> </dl> </dd> @@ -5154,17 +5184,17 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <dd> <dl> - <dt><span class="sect1"><a href="#id2636227">15.1. + <dt><span class="sect1"><a href="#id2636739">15.1. Submitting your packages</a></span></dt> - <dt><span class="sect1"><a href="#id2636284">15.2. + <dt><span class="sect1"><a href="#id2636796">15.2. Committing: Importing a package into CVS</a></span></dt> - <dt><span class="sect1"><a href="#id2636484">15.3. + <dt><span class="sect1"><a href="#id2636859">15.3. Updating a package to a newer version</a></span></dt> - <dt><span class="sect1"><a href="#id2636503">15.4. + <dt><span class="sect1"><a href="#id2636878">15.4. Moving a package in pkgsrc</a></span></dt> </dl> </dd> @@ -5175,275 +5205,8 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <div class="titlepage"> <div> <div> - <h2 class="title"><a name="makefile" id= - "makefile"></a>Chapter 7. Programming in - <code class="filename">Makefile</code>s</h2> - </div> - </div> - </div> - - <div class="toc"> - <p><b>Table of Contents</b></p> - - <dl> - <dt><span class="sect1"><a href= - "#makefile.variables">7.1. <code class= - "filename">Makefile</code> variables</a></span></dt> - - <dt><span class="sect1"><a href="#makefile.code">7.2. - Code snippets</a></span></dt> - - <dd> - <dl> - <dt><span class="sect2"><a href="#id2627035">7.2.1. - Adding things to a list</a></span></dt> - - <dt><span class="sect2"><a href="#id2627113">7.2.2. - Converting an internal list into an external - list</a></span></dt> - - <dt><span class="sect2"><a href="#id2627131">7.2.3. - Passing variables to a shell - command</a></span></dt> - </dl> - </dd> - </dl> - </div> - - <p>WARNING: The <a 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 is - wrong. After the man page has been corrected, this chapter - will be updated. Until that, don't take it too serious.</p> - - <p>Pkgsrc consists of many <code class= - "filename">Makefile</code> fragments, each of which forms a - well-defined part of the pkgsrc system. Using the <a href= - "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"> - <span class="citerefentry"><span class= - "refentrytitle">make</span>(1)</span></a> system as a - programming language for a big system like pkgsrc requires - some discipline to keep the code correct and - understandable.</p> - - <p>The basic ingredients for <code class= - "filename">Makefile</code> programming are variables (which - are actually macros) and shell commands. Among these shell - commands may even be more complex ones like <a href= - "http://netbsd.gw.com/cgi-bin/man-cgi?awk+1+NetBSD-current"> - <span class="citerefentry"><span class= - "refentrytitle">awk</span>(1)</span></a> programs. To make - sure that every shell command runs as intended it is - necessary to quote all variables correctly when they are - used.</p> - - <p>This chapter describes some patterns, that appear quite - often in <code class="filename">Makefile</code>s, including - the pitfalls that come along with them.</p> - - <div class="sect1" lang="en" xml:lang="en"> - <div class="titlepage"> - <div> - <div> - <h2 class="title" style="clear: both"><a name= - "makefile.variables" id= - "makefile.variables"></a>7.1. <code class= - "filename">Makefile</code> variables</h2> - </div> - </div> - </div> - - <p>A restriction common to all types of variables is that - they can neither contain a newline character nor the '\0' - character nor the '#' character. The effects of the - backslash character are not documented, so you should not - use it at the moment. As the $ is used to get values of a - <code class="filename">Makefile</code> variable, it must - be quoted as $$.</p> - - <p>There are several types of variables that must be - handled differently.</p> - - <div class="itemizedlist"> - <ul type="disc"> - <li> - <p><span class="emphasis"><em>Simple - values</em></span> (which I will call atoms) can - contain any string, which does not have to be - quoted in any way. All other types are somewhat - restricted in their possible values.</p> - </li> - - <li> - <p><span class="emphasis"><em>Internal - lists</em></span> are lists that are never exported - to any shell command. Their elements are separated - by whitespace. Therefore the elements themselves - cannot have embedded whitespace. Any other - characters are allowed. Internal lists can be used - in <code class="varname">.for</code> loops. - Examples are <code class="varname">DEPENDS</code>, - <code class="varname">BUILD_DEPENDS</code>.</p> - </li> - - <li> - <p><span class="emphasis"><em>External - lists</em></span> are lists that may be exported to - a shell command. Their elements can contain any - characters, including whitespace. That's why they - cannot be used in <code class="varname">.for</code> - loops. Examples are <code class= - "varname">DISTFILES</code> and <code class= - "varname">MASTER_SITES</code>.</p> - </li> - </ul> - </div> - </div> - - <div class="sect1" lang="en" xml:lang="en"> - <div class="titlepage"> - <div> - <div> - <h2 class="title" style="clear: both"><a name= - "makefile.code" id= - "makefile.code"></a>7.2. Code snippets</h2> - </div> - </div> - </div> - - <p>This section presents you with some code snippets you - should use in your own code. If you don't find anything - appropriate here, you should test your code and add it - here.</p> - - <div class="sect2" lang="en" xml:lang="en"> - <div class="titlepage"> - <div> - <div> - <h3 class="title"><a name="id2627035" id= - "id2627035"></a>7.2.1. Adding things to a - list</h3> - </div> - </div> - </div> - <pre class="programlisting"> -ATOM= foo * bar `date` -INT_LIST= # empty -ANOTHER_INT_LIST= apache-[0-9]*:../../www/apache -EXT_LIST= # empty -ANOTHER_EXT_LIST= a=b c=d - -INT_LIST+= ${ATOM} # 1 -INT_LIST+= ${ANOTHER_INT_LIST} # 2 -EXT_LIST+= ${ATOM:Q} # 3 -EXT_LIST+= ${ANOTHER_EXT_LIST} # 4 - -</pre> - - <p>When you add an atom to an external list (example - 3), it must be quoted. In all other cases, you must not - add a quoting level. You must not merge internal and - external lists, unless you are sure that all entries - are correctly interpreted in both lists.</p> - </div> - - <div class="sect2" lang="en" xml:lang="en"> - <div class="titlepage"> - <div> - <div> - <h3 class="title"><a name="id2627113" id= - "id2627113"></a>7.2.2. Converting an - internal list into an external list</h3> - </div> - </div> - </div> - <pre class="programlisting"> -EXT_LIST= # empty -.for i in ${INT_LIST} -EXT_LIST+= ${i:Q} -.endfor - -</pre> - - <p>This code converts the internal list <code class= - "varname">INT_LIST</code> into the external list - <code class="varname">EXT_LIST</code>. As the elements - of an internal list are unquoted they must be quoted - here.</p> - </div> - - <div class="sect2" lang="en" xml:lang="en"> - <div class="titlepage"> - <div> - <div> - <h3 class="title"><a name="id2627131" id= - "id2627131"></a>7.2.3. Passing variables to - a shell command</h3> - </div> - </div> - </div> - <pre class="programlisting"> -ATOM= foo bar < > * `date` $$HOME ' " -EXT_LIST= atom=${ATOM:Q} x=second\ item - -all: - echo ${ATOM} # 1 - echo "${ATOM}" # 2 - echo "${ATOM:Q}" # 3 - echo ${ATOM:Q} # 4 - echo x${ATOM:Q} | sed 1s,.,, # 5 - env ${EXT_LIST} /bin/sh -c 'echo "$$atom"; echo "$$x"' - -</pre> - - <p>Example 1 leads to a syntax error in the shell, as - the characters are just copied.</p> - - <p>Example 2 leads to a syntax error too, and if you - leave out the last " character from <code class= - "varname">${ATOM}</code>, <a href= - "http://netbsd.gw.com/cgi-bin/man-cgi?date+1+NetBSD-current"> - <span class="citerefentry"><span class= - "refentrytitle">date</span>(1)</span></a> would be - executed. The <code class="varname">$HOME</code> shell - variable would be evaluated, too.</p> - - <p>Example 3 would output each space character preceded - by a backslash (or not), depending on the - implementation of the <a href= - "http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-current"> - <span class="citerefentry"><span class= - "refentrytitle">echo</span>(1)</span></a> command.</p> - - <p>Example 4 handles correctly every string that does - not start with a dash. In that case, the result depends - on the implementation of the <a href= - "http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-current"> - <span class="citerefentry"><span class= - "refentrytitle">echo</span>(1)</span></a> command. As - long as you can guarantee that your input does not - start with a dash this form is appropriate.</p> - - <p>Example 5 handles even the case of a leading dash - correctly.</p> - - <p>The <code class="varname">EXT_LIST</code> does not - need to be quoted because the quoting has already be - done when adding elements to the list.</p> - - <p>As internal lists shall not be passed to the shell, - there is no example for it.</p> - </div> - </div> - </div> - - <div class="chapter" lang="en" xml:lang="en"> - <div class="titlepage"> - <div> - <div> <h2 class="title"><a name="components" id= - "components"></a>Chapter 8. Package + "components"></a>Chapter 7. Package components - files, directories and contents</h2> </div> </div> @@ -5454,27 +5217,27 @@ all: <dl> <dt><span class="sect1"><a href= - "#components.Makefile">8.1. <code class= + "#components.Makefile">7.1. <code class= "filename">Makefile</code></a></span></dt> <dt><span class="sect1"><a href= - "#components.distinfo">8.2. <code class= + "#components.distinfo">7.2. <code class= "filename">distinfo</code></a></span></dt> <dt><span class="sect1"><a href= - "#components.patches">8.3. patches/*</a></span></dt> + "#components.patches">7.3. patches/*</a></span></dt> - <dt><span class="sect1"><a href="#id2627827">8.4. Other + <dt><span class="sect1"><a href="#id2627632">7.4. Other mandatory files</a></span></dt> <dt><span class="sect1"><a href= - "#components.optional">8.5. Optional + "#components.optional">7.5. Optional files</a></span></dt> - <dt><span class="sect1"><a href="#id2628089">8.6. + <dt><span class="sect1"><a href="#id2627757">7.6. <code class="filename">work*</code></a></span></dt> - <dt><span class="sect1"><a href="#id2628177">8.7. + <dt><span class="sect1"><a href="#id2627845">7.7. <code class="filename">files/*</code></a></span></dt> </dl> </div> @@ -5489,7 +5252,7 @@ all: <div> <h2 class="title" style="clear: both"><a name= "components.Makefile" id= - "components.Makefile"></a>8.1. <code class= + "components.Makefile"></a>7.1. <code class= "filename">Makefile</code></h2> </div> </div> @@ -5522,7 +5285,12 @@ all: of the package, as used by pkgsrc. You only need to provide it if it differs from DISTNAME. Usually it is the directory name together with the version - number.</p> + number. It must match the regular expression + <code class= + "varname">^[A-Za-z0-9][A-Za-z0-9-_.+]*$</code>, + that is, it starts with a letter or digit, and + contains only letters, digits, dashes, underscores, + dots and plus signs.</p> </li> <li> @@ -5570,20 +5338,26 @@ all: set to one of the predefined sites:</p> <pre class="programlisting"> ${MASTER_SITE_APACHE} + ${MASTER_SITE_BACKUP} + ${MASTER_SITE_CYGWIN} ${MASTER_SITE_DEBIAN} + ${MASTER_SITE_FREEBSD} + ${MASTER_SITE_FREEBSD_LOCAL} ${MASTER_SITE_GNOME} ${MASTER_SITE_GNU} ${MASTER_SITE_GNUSTEP} ${MASTER_SITE_IFARCHIVE} ${MASTER_SITE_MOZILLA} + ${MASTER_SITE_OPENOFFICE} ${MASTER_SITE_PERL_CPAN} + ${MASTER_SITE_R_CRAN} ${MASTER_SITE_SOURCEFORGE} ${MASTER_SITE_SUNSITE} - ${MASTER_SITE_R_CRAN} ${MASTER_SITE_SUSE} ${MASTER_SITE_TEX_CTAN} ${MASTER_SITE_XCONTRIB} - ${MASTER_SITE_XEMACS} + ${MASTER_SITE_XEMACS} + </pre> <p>If one of these predefined sites is chosen, you may @@ -5700,7 +5474,7 @@ converters games mbone print x11 <div> <h2 class="title" style="clear: both"><a name= "components.distinfo" id= - "components.distinfo"></a>8.2. <code class= + "components.distinfo"></a>7.2. <code class= "filename">distinfo</code></h2> </div> </div> @@ -5745,7 +5519,7 @@ converters games mbone print x11 patches found in the <code class= "filename">patches/</code> directory (see <a href= "#components.patches" title= - "8.3. patches/*">Section 8.3, + "7.3. patches/*">Section 7.3, “patches/*”</a>) for the package is also stored in the <code class="filename">distinfo</code> file. This is a message digest/checksum of all lines in @@ -5762,7 +5536,7 @@ converters games mbone print x11 <div> <h2 class="title" style="clear: both"><a name= "components.patches" id= - "components.patches"></a>8.3. patches/*</h2> + "components.patches"></a>7.3. patches/*</h2> </div> </div> </div> @@ -5823,7 +5597,7 @@ converters games mbone print x11 <span><strong class="command">make makepatchsum</strong></span> command, see <a href= "#components.distinfo" title= - "8.2. distinfo">Section 8.2, + "7.2. distinfo">Section 7.2, “<code class="filename">distinfo</code>”</a>.</p> <p>Patch files that are distributed by the author or @@ -5853,7 +5627,7 @@ converters games mbone print x11 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2627827" id="id2627827"></a>8.4. Other + "id2627632" id="id2627632"></a>7.4. Other mandatory files</h2> </div> </div> @@ -5896,7 +5670,7 @@ converters games mbone print x11 <div> <h2 class="title" style="clear: both"><a name= "components.optional" id= - "components.optional"></a>8.5. Optional + "components.optional"></a>7.5. Optional files</h2> </div> </div> @@ -5977,8 +5751,8 @@ MESSAGE_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "id2628089" id= - "id2628089"></a>8.6. <code class= + "id2627757" id= + "id2627757"></a>7.6. <code class= "filename">work*</code></h2> </div> </div> @@ -6001,7 +5775,7 @@ MESSAGE_SUBST+= SOMEVAR="somevalue" class="pkgname">editors/sam</a> again, but the quick answer is:</p> <pre class="programlisting"> -WRKSRC= ${WRKDIR} +WRKSRC= ${WRKDIR} </pre> <p>Please note that the old <code class= @@ -6038,8 +5812,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <div> <div> <h2 class="title" style="clear: both"><a name= - "id2628177" id= - "id2628177"></a>8.7. <code class= + "id2627845" id= + "id2627845"></a>7.7. <code class= "filename">files/*</code></h2> </div> </div> @@ -6061,6 +5835,523 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <div class="titlepage"> <div> <div> + <h2 class="title"><a name="makefile" id= + "makefile"></a>Chapter 8. Programming in + <code class="filename">Makefile</code>s</h2> + </div> + </div> + </div> + + <div class="toc"> + <p><b>Table of Contents</b></p> + + <dl> + <dt><span class="sect1"><a href= + "#makefile.variables">8.1. <code class= + "filename">Makefile</code> variables</a></span></dt> + + <dd> + <dl> + <dt><span class="sect2"><a href= + "#makefile.variables.names">8.1.1. Naming + conventions</a></span></dt> + </dl> + </dd> + + <dt><span class="sect1"><a href="#makefile.code">8.2. + Code snippets</a></span></dt> + + <dd> + <dl> + <dt><span class="sect2"><a href="#id2628274">8.2.1. + Adding things to a list</a></span></dt> + + <dt><span class="sect2"><a href="#id2628283">8.2.2. + Converting an internal list into an external + list</a></span></dt> + + <dt><span class="sect2"><a href="#id2628305">8.2.3. + Passing variables to a shell + command</a></span></dt> + + <dt><span class="sect2"><a href="#id2628426">8.2.4. + Quoting guideline</a></span></dt> + + <dt><span class="sect2"><a href="#id2628677">8.2.5. + Workaround for a bug in BSD Make</a></span></dt> + </dl> + </dd> + </dl> + </div> + + <p>Pkgsrc consists of many <code class= + "filename">Makefile</code> fragments, each of which forms a + well-defined part of the pkgsrc system. Using the <a href= + "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"> + <span class="citerefentry"><span class= + "refentrytitle">make</span>(1)</span></a> system as a + programming language for a big system like pkgsrc requires + some discipline to keep the code correct and + understandable.</p> + + <p>The basic ingredients for <code class= + "filename">Makefile</code> programming are variables (which + are actually macros) and shell commands. Among these shell + commands may even be more complex ones like <a href= + "http://netbsd.gw.com/cgi-bin/man-cgi?awk+1+NetBSD-current"> + <span class="citerefentry"><span class= + "refentrytitle">awk</span>(1)</span></a> programs. To make + sure that every shell command runs as intended it is + necessary to quote all variables correctly when they are + used.</p> + + <p>This chapter describes some patterns, that appear quite + often in <code class="filename">Makefile</code>s, including + the pitfalls that come along with them.</p> + + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a name= + "makefile.variables" id= + "makefile.variables"></a>8.1. <code class= + "filename">Makefile</code> variables</h2> + </div> + </div> + </div> + + <p><code class="filename">Makefile</code> variables + contain strings that can be processed using the five + operators ``='', ``+='', ``?='', ``:='', and ``!='', + which are described in the <a 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.</p> + + <p>When a variable's value is parsed from a <code class= + "filename">Makefile</code>, the hash character ``#'' and + the backslash character ``\'' are handled specially. If a + backslash is followed by a newline, any whitespace + immediately in front of the backslash, the backslash, the + newline, and any whitespace immediately behind the + newline are replaced with a single space. A backspace + character and an immediately following hash character are + replaced with a single hash character. Otherwise the + backslash is passed as is. In a variable assignment, any + hash character that is not preceded by a backslash starts + a comment that continues upto the end of the logical + line.</p> + + <p><span class="emphasis"><em>Note:</em></span> Because + of this parsing algorithm the only way to create a + variable consisting of a single backslash is using the + ``!='' operator, for example: <code class= + "varname">BACKSLASH!=echo "\\"</code>.</p> + + <p>So far for defining variables. The other thing you can + do with variables is evaluating them. A variable is + evaluated when it is part of the right side of the ``:='' + or the ``!='' operator, or directly before executing a + shell command which the variable is part of. In all other + cases <a 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 is, variables are not evaluated until + there's no other way. The ``modifiers'' mentioned in the + man page also evaluate the variable.</p> + + <p>Some of the modifiers split the string into words and + then operate on the words, others operate on the string + as a whole. When a string is splitted into words, it is + splitted as you would expect it from <a 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> + + <p>No rule without exception—the + <span><strong class="command">.for</strong></span> loop + does not follow the shell quoting rules but splits at + sequences of whitespace.</p> + + <p>There are several types of variables that should be + handled differently. Strings and two types of lists.</p> + + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p><span class="emphasis"><em>Strings</em></span> + can contain arbitrary characters. Nevertheless you + should restrict yourself to only using printable + characters. Examples are <code class= + "varname">PREFIX</code> and <code class= + "varname">COMMENT</code>.</p> + </li> + + <li> + <p><span class="emphasis"><em>Internal + lists</em></span> are lists that are never exported + to any shell command. Their elements are separated + by whitespace. Therefore the elements themselves + cannot have embedded whitespace. Any other + characters are allowed. Internal lists can be used + in <span><strong class= + "command">.for</strong></span> loops. Examples are + <code class="varname">DEPENDS</code> and + <code class="varname">BUILD_DEPENDS</code>.</p> + </li> + + <li> + <p><span class="emphasis"><em>External + lists</em></span> are lists that may be exported to + a shell command. Their elements can contain any + characters, including whitespace. That's why they + cannot be used in <span><strong class= + "command">.for</strong></span> loops. Examples are + <code class="varname">DISTFILES</code> and + <code class="varname">MASTER_SITES</code>.</p> + </li> + </ul> + </div> + + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a name= + "makefile.variables.names" id= + "makefile.variables.names"></a>8.1.1. Naming + conventions</h3> + </div> + </div> + </div> + + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p>All variable names starting with an underscore + are reserved for use by the pkgsrc + infrastructure. They shall not be used by package + <code class="filename">Makefile</code>s.</p> + </li> + + <li> + <p>In <span><strong class= + "command">.for</strong></span> loops you should + use lowercase variable names for the iteration + variables.</p> + </li> + + <li> + <p>All list variables should have a ``plural'' + name, e.g. <code class= + "varname">PKG_OPTIONS</code> or <code class= + "varname">DISTFILES</code>.</p> + </li> + </ul> + </div> + </div> + </div> + + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a name= + "makefile.code" id= + "makefile.code"></a>8.2. Code snippets</h2> + </div> + </div> + </div> + + <p>This section presents you with some code snippets you + should use in your own code. If you don't find anything + appropriate here, you should test your code and add it + here.</p> + + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a name="id2628274" id= + "id2628274"></a>8.2.1. Adding things to a + list</h3> + </div> + </div> + </div> + <pre class="programlisting"> +STRING= foo * bar `date` +INT_LIST= # empty +ANOTHER_INT_LIST= apache-[0-9]*:../../www/apache +EXT_LIST= # empty +ANOTHER_EXT_LIST= a=b c=d + +INT_LIST+= ${STRING} # 1 +INT_LIST+= ${ANOTHER_INT_LIST} # 2 +EXT_LIST+= ${STRING:Q} # 3 +EXT_LIST+= ${ANOTHER_EXT_LIST} # 4 + +</pre> + + <p>When you add a string to an external list (example + 3), it must be quoted. In all other cases, you must not + add a quoting level. You must not merge internal and + external lists, unless you are sure that all entries + are correctly interpreted in both lists.</p> + </div> + + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a name="id2628283" id= + "id2628283"></a>8.2.2. Converting an + internal list into an external list</h3> + </div> + </div> + </div> + <pre class="programlisting"> +EXT_LIST= # empty +.for i in ${INT_LIST} +EXT_LIST+= ${i:Q}"" +.endfor + +</pre> + + <p>This code converts the internal list <code class= + "varname">INT_LIST</code> into the external list + <code class="varname">EXT_LIST</code>. As the elements + of an internal list are unquoted they must be quoted + here. The reason for appending <code class= + "varname">""</code> is explained below.</p> + </div> + + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a name="id2628305" id= + "id2628305"></a>8.2.3. Passing variables to + a shell command</h3> + </div> + </div> + </div> + <pre class="programlisting"> +STRING= foo bar < > * `date` $$HOME ' " +EXT_LIST= string=${STRING:Q} x=second\ item + +all: + echo ${STRING} # 1 + echo "${STRING}" # 2 + echo "${STRING:Q}" # 3 + echo ${STRING:Q} # 4 + echo x${STRING:Q} | sed 1s,.,, # 5 + env ${EXT_LIST} /bin/sh -c 'echo "$$string"; echo "$$x"' + +</pre> + + <p>Example 1 leads to a syntax error in the shell, as + the characters are just copied.</p> + + <p>Example 2 leads to a syntax error too, and if you + leave out the last " character from <code class= + "varname">${STRING}</code>, <a href= + "http://netbsd.gw.com/cgi-bin/man-cgi?date+1+NetBSD-current"> + <span class="citerefentry"><span class= + "refentrytitle">date</span>(1)</span></a> will be + executed. The <code class="varname">$HOME</code> shell + variable would be evaluated, too.</p> + + <p>Example 3 outputs each space character preceded by a + backslash (or not), depending on the implementation of + the <a href= + "http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-current"> + <span class="citerefentry"><span class= + "refentrytitle">echo</span>(1)</span></a> command.</p> + + <p>Example 4 handles correctly every string that does + not start with a dash. In that case, the result depends + on the implementation of the <a href= + "http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-current"> + <span class="citerefentry"><span class= + "refentrytitle">echo</span>(1)</span></a> command. As + long as you can guarantee that your input does not + start with a dash this form is appropriate.</p> + + <p>Example 5 handles even the case of a leading dash + correctly.</p> + + <p>The <code class="varname">EXT_LIST</code> does not + need to be quoted because the quoting has already be + done when adding elements to the list.</p> + + <p>As internal lists shall not be passed to the shell, + there is no example for it.</p> + </div> + + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a name="id2628426" id= + "id2628426"></a>8.2.4. Quoting + guideline</h3> + </div> + </div> + </div> + + <p>There are many possible sources of wrongly quoted + variables. This section lists some of the commonly + known ones.</p> + + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p>Whenever you use the value of a list, think + about what happens to leading or trailing + whitespace. If the list is a well-formed shell + expression you can apply the <code class= + "varname">:M*</code> modifier to strip leading + and trailing whitespace from each word. The + <code class="varname">:M</code> operator first + splits its argument according to the rules of the + shell, and then creates a new list consisting of + all words that match the shell glob expression + <code class="varname">*</code>, that is: all. One + class of situations where this is needed is when + adding a variable like <code class= + "varname">CPPFLAGS</code> to <code class= + "varname">CONFIGURE_ARGS</code>. If the configure + script invokes other configure scripts it strips + the leading and trailing whitespace from the + variable and then passes it to the other + configure scripts. But these configure scripts + expect the (child) <code class= + "varname">CPPFLAGS</code> variable to be the same + as the parent <code class= + "varname">CPPFLAGS</code>. That's why we better + pass the <code class="varname">CPPFLAGS</code> + value properly trimmed. And here is how we do + it:</p> + <pre class="programlisting"> +CPPFLAGS= # empty +CPPFLAGS+= -Wundef -DPREFIX=\"${PREFIX:Q}\" +CPPFLAGS+= ${MY_CPPFLAGS} + +CONFIGURE_ARGS+= CPPFLAGS=${CPPFLAGS:M*:Q} + +all: + echo x${CPPFLAGS:Q}x # leading and trailing whitespace + echo x${CONFIGURE_ARGS}x # properly trimmed + +</pre> + </li> + + <li> + <p>The example above contains one bug: The + <code class="varname">${PREFIX}</code> is a + properly quoted shell expression, but there is + the C compiler after it, which also expects a + properly quoted string (this time in C syntax). + The version above is therefore only correct if + <code class="varname">${PREFIX}</code> does not + have embedded backslashes or double quotes. If + you want to allow these, you have to add another + layer of quoting to each variable that is used as + a C string literal. You cannot use the + <code class="varname">:Q</code> operator for it, + as this operator only works for the shell.</p> + </li> + + <li> + <p>Whenever a variable can be empty the + <code class="varname">:Q</code> operator can have + surprising results. Here are two completely + different cases which can be solved with the same + trick.</p> + <pre class="programlisting"> +EMPTY= # empty +empty_test: + for i in a ${EMPTY:Q} c; do \ + echo "$$i"; \ + done + +for_test: +.for i in a:\ a:\test.txt + echo ${i:Q} + echo "foo" +.endfor + +</pre> + + <p>The first example will only print two of the + three lines we might have expected. This is + because <code class="varname">${EMPTY:Q}</code> + expands to the empty string, which the shell + cannot see. The workaround is to write + <code class="varname">${EMPTY:Q}""</code>. This + pattern can be often found as <code class= + "varname">${TEST} -z ${VAR:Q}</code> or as + <code class="varname">${TEST} -f + ${FNAME:Q}</code> (both of these are wrong).</p> + + <p>The second example will only print three lines + instead of four. The first line looks like + <code class="varname">a:\ echo foo</code>. This + is because the backslash of the value + <code class="varname">a:\</code> is interpreted + as a line-continuation by <a href= + "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"> + <span class="citerefentry"><span class= + "refentrytitle">make</span>(1)</span></a>, which + makes the second line the arguments of the + <a href= + "http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-current"> + <span class="citerefentry"><span class= + "refentrytitle">echo</span>(1)</span></a> command + from the first line. To avoid this, write + <code class="varname">${i:Q}""</code>.</p> + </li> + </ul> + </div> + </div> + + <div class="sect2" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h3 class="title"><a name="id2628677" id= + "id2628677"></a>8.2.5. Workaround for a bug + in BSD Make</h3> + </div> + </div> + </div> + + <p>The pkgsrc bmake program does not handle the + following assignment correctly. In case <code class= + "varname">_othervar_</code> contains a ``-'' character, + one of the closing braces is included in <code class= + "varname">${VAR}</code> after this code executes.</p> + <pre class="programlisting"> + VAR:= ${VAR:N${_othervar_:C/-//}} + +</pre> + + <p>For a more complex code snippet and a workaround, + see the package <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/regress/make-quoting/README.html" + class="pkgname">regress/make-quoting</a>, testcase + <code class="varname">bug1</code>.</p> + </div> + </div> + </div> + + <div class="chapter" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> <h2 class="title"><a name="plist" id= "plist"></a>Chapter 9. PLIST issues</h2> </div> @@ -6071,10 +6362,10 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2628231">9.1. RCS + <dt><span class="sect1"><a href="#id2628738">9.1. RCS ID</a></span></dt> - <dt><span class="sect1"><a href="#id2628246">9.2. + <dt><span class="sect1"><a href="#id2628753">9.2. Semi-automatic <code class="filename">PLIST</code> generation</a></span></dt> @@ -6085,14 +6376,14 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <dt><span class="sect1"><a href="#plist.misc">9.4. Variable substitution in PLIST</a></span></dt> - <dt><span class="sect1"><a href="#id2628499">9.5. + <dt><span class="sect1"><a href="#id2629074">9.5. Manpage-compression</a></span></dt> - <dt><span class="sect1"><a href="#id2628609">9.6. + <dt><span class="sect1"><a href="#id2629115">9.6. Changing PLIST source with <code class= "varname">PLIST_SRC</code></a></span></dt> - <dt><span class="sect1"><a href="#id2628633">9.7. + <dt><span class="sect1"><a href="#id2629140">9.7. Platform specific and differing PLISTs</a></span></dt> <dt><span class="sect1"><a href="#faq.common-dirs">9.8. @@ -6118,7 +6409,7 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <div> <div> <h2 class="title" style="clear: both"><a name= - "id2628231" id="id2628231"></a>9.1. RCS + "id2628738" id="id2628738"></a>9.1. RCS ID</h2> </div> </div> @@ -6136,8 +6427,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <div> <div> <h2 class="title" style="clear: both"><a name= - "id2628246" id= - "id2628246"></a>9.2. Semi-automatic + "id2628753" id= + "id2628753"></a>9.2. Semi-automatic <code class="filename">PLIST</code> generation</h2> </div> </div> @@ -6315,7 +6606,7 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix variable in the following way, similar to <code class= "varname">MESSAGE_SUBST</code> (see <a href= "#components.optional" title= - "8.5. Optional files">Section 8.5, + "7.5. Optional files">Section 7.5, “Optional files”</a>):</p> <pre class="programlisting"> PLIST_SUBST+= SOMEVAR="somevalue" @@ -6331,8 +6622,8 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "id2628499" id= - "id2628499"></a>9.5. Manpage-compression</h2> + "id2629074" id= + "id2629074"></a>9.5. Manpage-compression</h2> </div> </div> </div> @@ -6356,7 +6647,7 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "id2628609" id="id2628609"></a>9.6. Changing + "id2629115" id="id2629115"></a>9.6. Changing PLIST source with <code class= "varname">PLIST_SRC</code></h2> </div> @@ -6379,7 +6670,7 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "id2628633" id="id2628633"></a>9.7. Platform + "id2629140" id="id2629140"></a>9.7. Platform specific and differing PLISTs</h2> </div> </div> @@ -6524,21 +6815,21 @@ PLIST_SUBST+= SOMEVAR="somevalue" <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2628968">10.1. + <dt><span class="sect1"><a href="#id2629406">10.1. Converting packages to use buildlink3</a></span></dt> - <dt><span class="sect1"><a href="#id2629149">10.2. + <dt><span class="sect1"><a href="#id2629724">10.2. Writing <code class="filename">buildlink3.mk</code> files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2629219">10.2.1. Anatomy of a buildlink3.mk + "#id2629794">10.2.1. Anatomy of a buildlink3.mk file</a></span></dt> <dt><span class="sect2"><a href= - "#id2629796">10.2.2. Updating <code class= + "#id2630166">10.2.2. Updating <code class= "varname">BUILDLINK_DEPENDS.<em class= "replaceable"><code>pkg</code></em></code> in <code class="filename">buildlink3.mk</code> @@ -6546,18 +6837,18 @@ PLIST_SUBST+= SOMEVAR="somevalue" </dl> </dd> - <dt><span class="sect1"><a href="#id2629943">10.3. + <dt><span class="sect1"><a href="#id2630245">10.3. Writing <code class="filename">builtin.mk</code> files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2630024">10.3.1. Anatomy of a <code class= + "#id2630394">10.3.1. Anatomy of a <code class= "filename">builtin.mk</code> file</a></span></dt> <dt><span class="sect2"><a href= - "#id2630183">10.3.2. Global preferences for native + "#id2630621">10.3.2. Global preferences for native or pkgsrc software</a></span></dt> </dl> </dd> @@ -6607,8 +6898,8 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "id2628968" id= - "id2628968"></a>10.1. Converting packages to + "id2629406" id= + "id2629406"></a>10.1. Converting packages to use buildlink3</h2> </div> </div> @@ -6654,7 +6945,7 @@ PLIST_SUBST+= SOMEVAR="somevalue" <p>If a dependency on a particular package is required for its libraries and headers, then we replace:</p> <pre class="programlisting"> -DEPENDS+= foo>=1.1.0:../../category/foo +DEPENDS+= foo>=1.1.0:../../category/foo </pre> <p>with</p> @@ -6753,7 +7044,7 @@ DEPENDS+= foo>=1.1.0:../../category/foo <div> <div> <h2 class="title" style="clear: both"><a name= - "id2629149" id="id2629149"></a>10.2. Writing + "id2629724" id="id2629724"></a>10.2. Writing <code class="filename">buildlink3.mk</code> files</h2> </div> @@ -6793,8 +7084,8 @@ DEPENDS+= foo>=1.1.0:../../category/foo <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2629219" id= - "id2629219"></a>10.2.1. Anatomy of a + <h3 class="title"><a name="id2629794" id= + "id2629794"></a>10.2.1. Anatomy of a buildlink3.mk file</h3> </div> </div> @@ -7024,8 +7315,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2629796" id= - "id2629796"></a>10.2.2. Updating <code class= + <h3 class="title"><a name="id2630166" id= + "id2630166"></a>10.2.2. Updating <code class= "varname">BUILDLINK_DEPENDS.<em class= "replaceable"><code>pkg</code></em></code> in <code class="filename">buildlink3.mk</code> @@ -7094,7 +7385,7 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <div> <div> <h2 class="title" style="clear: both"><a name= - "id2629943" id="id2629943"></a>10.3. Writing + "id2630245" id="id2630245"></a>10.3. Writing <code class="filename">builtin.mk</code> files</h2> </div> </div> @@ -7146,8 +7437,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2630024" id= - "id2630024"></a>10.3.1. Anatomy of a + <h3 class="title"><a name="id2630394" id= + "id2630394"></a>10.3.1. Anatomy of a <code class="filename">builtin.mk</code> file</h3> </div> @@ -7272,8 +7563,8 @@ CHECK_BUILTIN.foo?= no <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2630183" id= - "id2630183"></a>10.3.2. Global preferences + <h3 class="title"><a name="id2630621" id= + "id2630621"></a>10.3.2. Global preferences for native or pkgsrc software</h3> </div> </div> @@ -7331,10 +7622,10 @@ CHECK_BUILTIN.foo?= no <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2630256">11.1. + <dt><span class="sect1"><a href="#id2630762">11.1. Global default options</a></span></dt> - <dt><span class="sect1"><a href="#id2630270">11.2. + <dt><span class="sect1"><a href="#id2630777">11.2. Converting packages to use <code class= "filename">bsd.options.mk</code></a></span></dt> </dl> @@ -7354,7 +7645,7 @@ CHECK_BUILTIN.foo?= no <div> <div> <h2 class="title" style="clear: both"><a name= - "id2630256" id="id2630256"></a>11.1. Global + "id2630762" id="id2630762"></a>11.1. Global default options</h2> </div> </div> @@ -7372,8 +7663,8 @@ CHECK_BUILTIN.foo?= no <div> <div> <h2 class="title" style="clear: both"><a name= - "id2630270" id= - "id2630270"></a>11.2. Converting packages to + "id2630777" id= + "id2630777"></a>11.2. Converting packages to use <code class= "filename">bsd.options.mk</code></h2> </div> @@ -7381,28 +7672,19 @@ CHECK_BUILTIN.foo?= no </div> <p>The following example shows how <code class= - "filename">bsd.options.mk</code> should be used in a - package <code class="filename">Makefile</code>, or in a - file, e.g. <code class="filename">options.mk</code>, that - is included by the main package <code class= + "filename">bsd.options.mk</code> should be used by the + hypothetical ``wibble'' package, either in the package + <code class="filename">Makefile</code>, or in a file, + e.g. <code class="filename">options.mk</code>, that is + included by the main package <code class= "filename">Makefile</code>.</p> <pre class="programlisting"> # Global and legacy options -.if defined(WIBBLE_USE_OPENLDAP) && !empty(WIBBLE_USE_OPENLDAP:M[yY][eE][sS]) -PKG_DEFAULT_OPTIONS+= ldap -.endif -.if defined(USE_SASL2) && !empty(USE_SASL2:M[yY][eE][sS]) -PKG_DEFAULT_OPTIONS+= sasl -.endif - PKG_OPTIONS_VAR= PKG_OPTIONS.wibble PKG_SUPPORTED_OPTIONS= ldap sasl -# -# Default options for "wibble" package. -# -.if !defined(PKG_OPTIONS.wibble) -PKG_DEFAULT_OPTIONS+= sasl -endif +PKG_SUGGESTED_OPTIONS= sasl +PKG_OPTION_LEGACY_VARS= WIBBLE_USE_OPENLDAP:ldap USE_SASL2:sasl + .include "../../mk/bsd.options.mk" # Package-specific option-handling @@ -7442,13 +7724,13 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} <ol type="1"> <li> <p><code class="varname">PKG_OPTIONS_VAR</code> is - a list of the name of the <a href= + the name of the <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"> <span class="citerefentry"><span class= - "refentrytitle">make</span>(1)</span></a> variables - that contain the options the user wishes to select. - The recommended value is “<span class= - "quote">PKG_OPTIONS.<em class= + "refentrytitle">make</span>(1)</span></a> variable + that contains the options the user wishes to + select. The recommended value is + “<span class="quote">PKG_OPTIONS.<em class= "replaceable"><code>pkg</code></em></span>” but any package-specific value may be used. This variable should be set in a package Makefile.</p> @@ -7462,11 +7744,17 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} </li> <li> + <p><code class= + "varname">PKG_SUGGESTED_OPTIONS</code> is a list of + build options which are enabled by default.</p> + </li> + + <li> <p><code class="varname">${PKG_OPTIONS_VAR}</code> - (the variables named in <code class= - "varname">PKG_OPTIONS_VAR</code>) are variables - that list the selected build options and override - any default options given in <code class= + (the variable named in <code class= + "varname">PKG_OPTIONS_VAR</code>) lists the + selected build options and overrides any default + options given in <code class= "varname">PKG_DEFAULT_OPTIONS</code>. If any of the options begin with a “<span class= "quote">-</span>”, then that option is always @@ -7536,7 +7824,7 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} <dt><span class="sect1"><a href="#build.prefix">12.1. Program location</a></span></dt> - <dt><span class="sect1"><a href="#id2631098">12.2. Main + <dt><span class="sect1"><a href="#id2631337">12.2. Main targets</a></span></dt> <dt><span class="sect1"><a href= @@ -7584,7 +7872,7 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} be put into the various places in the program's source where paths to these files are encoded. See <a href= "#components.patches" title= - "8.3. patches/*">Section 8.3, + "7.3. patches/*">Section 7.3, “patches/*”</a> and <a href="#fixes.libtool" title= "13.3.1. Shared libraries - libtool">Section 13.3.1, @@ -7738,7 +8026,7 @@ GTKDIR_DEFAULT= ${LOCALBASE} <div> <div> <h2 class="title" style="clear: both"><a name= - "id2631098" id="id2631098"></a>12.2. Main + "id2631337" id="id2631337"></a>12.2. Main targets</h2> </div> </div> @@ -7865,7 +8153,7 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} handed in <code class= "varname">PATCH_DIST_ARGS</code>. See <a href= "#components.patches" title= - "8.3. patches/*">Section 8.3, + "7.3. patches/*">Section 7.3, “patches/*”</a> for more details.</p> <p>By default <a href= @@ -8517,17 +8805,17 @@ make build <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2632458">13.1. + <dt><span class="sect1"><a href="#id2632834">13.1. General operation</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2632461">13.1.1. How to pull in variables from + "#id2632837">13.1.1. How to pull in variables from /etc/mk.conf</a></span></dt> <dt><span class="sect2"><a href= - "#id2632545">13.1.2. Restricted + "#id2632920">13.1.2. Restricted packages</a></span></dt> <dt><span class="sect2"><a href= @@ -8535,15 +8823,15 @@ make build dependencies</a></span></dt> <dt><span class="sect2"><a href= - "#id2633066">13.1.4. Handling conflicts with other + "#id2633373">13.1.4. Handling conflicts with other packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2633116">13.1.5. Packages that cannot or should + "#id2633492">13.1.5. Packages that cannot or should not be built</a></span></dt> <dt><span class="sect2"><a href= - "#id2633142">13.1.6. Packages which should not be + "#id2633517">13.1.6. Packages which should not be deleted, once installed</a></span></dt> <dt><span class="sect2"><a href= @@ -8551,37 +8839,37 @@ make build security problems</a></span></dt> <dt><span class="sect2"><a href= - "#id2633234">13.1.8. How to handle compiler + "#id2633677">13.1.8. How to handle compiler bugs</a></span></dt> <dt><span class="sect2"><a href= - "#id2633324">13.1.9. How to handle incrementing + "#id2633700">13.1.9. How to handle incrementing versions when fixing an existing package</a></span></dt> <dt><span class="sect2"><a href= - "#id2633373">13.1.10. Portability of + "#id2633817">13.1.10. Portability of packages</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2633398">13.2. + <dt><span class="sect1"><a href="#id2633842">13.2. Possible downloading issues</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2633401">13.2.1. Packages whose distfiles + "#id2633845">13.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt> <dt><span class="sect2"><a href= - "#id2633601">13.2.2. How to handle modified + "#id2633908">13.2.2. How to handle modified distfiles with the 'old' name</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2633612">13.3. + <dt><span class="sect1"><a href="#id2633920">13.3. Configuration gotchas</a></span></dt> <dd> @@ -8591,64 +8879,64 @@ make build libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2633978">13.3.2. Using libtool on GNU packages + "#id2634285">13.3.2. Using libtool on GNU packages that already support libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2634059">13.3.3. GNU + "#id2634503">13.3.3. GNU Autoconf/Automake</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2634104">13.4. + <dt><span class="sect1"><a href="#id2634616">13.4. Building considerations</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2634107">13.4.1. CPP defines</a></span></dt> + "#id2634619">13.4.1. CPP defines</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2634137">13.5. + <dt><span class="sect1"><a href="#id2634649">13.5. Package specific actions</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2634140">13.5.1. Package configuration + "#id2634652">13.5.1. Package configuration files</a></span></dt> <dt><span class="sect2"><a href= - "#id2634311">13.5.2. User + "#id2634755">13.5.2. User interaction</a></span></dt> <dt><span class="sect2"><a href= - "#id2634492">13.5.3. Handling + "#id2634800">13.5.3. Handling licenses</a></span></dt> <dt><span class="sect2"><a href= - "#id2634644">13.5.4. Creating an account from a + "#id2634951">13.5.4. Creating an account from a package</a></span></dt> <dt><span class="sect2"><a href= - "#id2634706">13.5.5. Installing score + "#id2635013">13.5.5. Installing score files</a></span></dt> <dt><span class="sect2"><a href= - "#id2634749">13.5.6. Packages providing login + "#id2635057">13.5.6. Packages providing login shells</a></span></dt> <dt><span class="sect2"><a href= - "#id2634807">13.5.7. Packages containing perl + "#id2635114">13.5.7. Packages containing perl scripts</a></span></dt> <dt><span class="sect2"><a href= - "#id2634825">13.5.8. Packages with hardcoded paths + "#id2635132">13.5.8. Packages with hardcoded paths to other interpreters</a></span></dt> <dt><span class="sect2"><a href= - "#id2634846">13.5.9. Packages installing perl + "#id2635154">13.5.9. Packages installing perl modules</a></span></dt> <dt><span class="sect2"><a href= @@ -8656,40 +8944,40 @@ make build files</a></span></dt> <dt><span class="sect2"><a href= - "#id2635134">13.5.11. Packages installing GConf2 + "#id2635510">13.5.11. Packages installing GConf2 data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2635303">13.5.12. Packages installing + "#id2635678">13.5.12. Packages installing scrollkeeper data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2635354">13.5.13. Packages installing X11 + "#id2635730">13.5.13. Packages installing X11 fonts</a></span></dt> <dt><span class="sect2"><a href= - "#id2635469">13.5.14. Packages installing GTK2 + "#id2635777">13.5.14. Packages installing GTK2 modules</a></span></dt> <dt><span class="sect2"><a href= - "#id2635539">13.5.15. Packages installing SGML or + "#id2635846">13.5.15. Packages installing SGML or XML data</a></span></dt> <dt><span class="sect2"><a href= - "#id2635659">13.5.16. Packages installing + "#id2635898">13.5.16. Packages installing extensions to the MIME database</a></span></dt> <dt><span class="sect2"><a href= - "#id2635730">13.5.17. Packages using + "#id2636037">13.5.17. Packages using intltool</a></span></dt> <dt><span class="sect2"><a href= - "#id2635744">13.5.18. Packages installing startup + "#id2636051">13.5.18. Packages installing startup scripts</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2635765">13.6. + <dt><span class="sect1"><a href="#id2636072">13.6. Feedback to the author</a></span></dt> </dl> </div> @@ -8699,7 +8987,7 @@ make build <div> <div> <h2 class="title" style="clear: both"><a name= - "id2632458" id="id2632458"></a>13.1. General + "id2632834" id="id2632834"></a>13.1. General operation</h2> </div> </div> @@ -8709,8 +8997,8 @@ make build <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2632461" id= - "id2632461"></a>13.1.1. How to pull in + <h3 class="title"><a name="id2632837" id= + "id2632837"></a>13.1.1. How to pull in variables from /etc/mk.conf</h3> </div> </div> @@ -8770,8 +9058,8 @@ CFLAGS+= -your -flags <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2632545" id= - "id2632545"></a>13.1.2. Restricted + <h3 class="title"><a name="id2632920" id= + "id2632920"></a>13.1.2. Restricted packages</h3> </div> </div> @@ -9078,8 +9366,8 @@ pre-clean: <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2633066" id= - "id2633066"></a>13.1.4. Handling conflicts + <h3 class="title"><a name="id2633373" id= + "id2633373"></a>13.1.4. Handling conflicts with other packages</h3> </div> </div> @@ -9126,8 +9414,8 @@ CONFLICTS= Xaw3d-[0-9]* <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2633116" id= - "id2633116"></a>13.1.5. Packages that cannot + <h3 class="title"><a name="id2633492" id= + "id2633492"></a>13.1.5. Packages that cannot or should not be built</h3> </div> </div> @@ -9158,8 +9446,8 @@ CONFLICTS= Xaw3d-[0-9]* <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2633142" id= - "id2633142"></a>13.1.6. Packages which + <h3 class="title"><a name="id2633517" id= + "id2633517"></a>13.1.6. Packages which should not be deleted, once installed</h3> </div> </div> @@ -9222,8 +9510,8 @@ CONFLICTS= Xaw3d-[0-9]* <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2633234" id= - "id2633234"></a>13.1.8. How to handle + <h3 class="title"><a name="id2633677" id= + "id2633677"></a>13.1.8. How to handle compiler bugs</h3> </div> </div> @@ -9248,8 +9536,8 @@ CONFLICTS= Xaw3d-[0-9]* <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2633324" id= - "id2633324"></a>13.1.9. How to handle + <h3 class="title"><a name="id2633700" id= + "id2633700"></a>13.1.9. How to handle incrementing versions when fixing an existing package</h3> </div> @@ -9289,8 +9577,8 @@ DISTNAME= foo-17.43 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2633373" id= - "id2633373"></a>13.1.10. Portability of + <h3 class="title"><a name="id2633817" id= + "id2633817"></a>13.1.10. Portability of packages</h3> </div> </div> @@ -9306,8 +9594,8 @@ DISTNAME= foo-17.43 <div class="titlepage"> <div> <div> - <h4 class="title"><a name="id2633379" id= - "id2633379"></a>13.1.10.1. ${INSTALL}, + <h4 class="title"><a name="id2633822" id= + "id2633822"></a>13.1.10.1. ${INSTALL}, ${INSTALL_DATA_DIR}, ...</h4> </div> </div> @@ -9332,7 +9620,7 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2633398" id="id2633398"></a>13.2. Possible + "id2633842" id="id2633842"></a>13.2. Possible downloading issues</h2> </div> </div> @@ -9342,8 +9630,8 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2633401" id= - "id2633401"></a>13.2.1. Packages whose + <h3 class="title"><a name="id2633845" id= + "id2633845"></a>13.2.1. Packages whose distfiles aren't available for plain downloading</h3> </div> @@ -9404,8 +9692,8 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2633601" id= - "id2633601"></a>13.2.2. How to handle + <h3 class="title"><a name="id2633908" id= + "id2633908"></a>13.2.2. How to handle modified distfiles with the 'old' name</h3> </div> </div> @@ -9434,8 +9722,8 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2633612" id= - "id2633612"></a>13.3. Configuration + "id2633920" id= + "id2633920"></a>13.3. Configuration gotchas</h2> </div> </div> @@ -9654,8 +9942,8 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2633978" id= - "id2633978"></a>13.3.2. Using libtool on GNU + <h3 class="title"><a name="id2634285" id= + "id2634285"></a>13.3.2. Using libtool on GNU packages that already support libtool</h3> </div> </div> @@ -9733,8 +10021,8 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634059" id= - "id2634059"></a>13.3.3. GNU + <h3 class="title"><a name="id2634503" id= + "id2634503"></a>13.3.3. GNU Autoconf/Automake</h3> </div> </div> @@ -9800,7 +10088,7 @@ pre-configure: <div> <div> <h2 class="title" style="clear: both"><a name= - "id2634104" id="id2634104"></a>13.4. Building + "id2634616" id="id2634616"></a>13.4. Building considerations</h2> </div> </div> @@ -9810,8 +10098,8 @@ pre-configure: <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634107" id= - "id2634107"></a>13.4.1. CPP defines</h3> + <h3 class="title"><a name="id2634619" id= + "id2634619"></a>13.4.1. CPP defines</h3> </div> </div> </div> @@ -9850,7 +10138,7 @@ pre-configure: <div> <div> <h2 class="title" style="clear: both"><a name= - "id2634137" id="id2634137"></a>13.5. Package + "id2634649" id="id2634649"></a>13.5. Package specific actions</h2> </div> </div> @@ -9860,8 +10148,8 @@ pre-configure: <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634140" id= - "id2634140"></a>13.5.1. Package + <h3 class="title"><a name="id2634652" id= + "id2634652"></a>13.5.1. Package configuration files</h3> </div> </div> @@ -9933,8 +10221,8 @@ pre-configure: <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634311" id= - "id2634311"></a>13.5.2. User + <h3 class="title"><a name="id2634755" id= + "id2634755"></a>13.5.2. User interaction</h3> </div> </div> @@ -9983,8 +10271,8 @@ INTERACTIVE_STAGE= configure install <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634492" id= - "id2634492"></a>13.5.3. Handling + <h3 class="title"><a name="id2634800" id= + "id2634800"></a>13.5.3. Handling licenses</h3> </div> </div> @@ -10058,8 +10346,8 @@ ACCEPTABLE_LICENSES+=graphviz-license <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634644" id= - "id2634644"></a>13.5.4. Creating an account + <h3 class="title"><a name="id2634951" id= + "id2634951"></a>13.5.4. Creating an account from a package</h3> </div> </div> @@ -10113,8 +10401,8 @@ user:group[:[userid][:[description][:[home][:shell]]]] <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634706" id= - "id2634706"></a>13.5.5. Installing score + <h3 class="title"><a name="id2635013" id= + "id2635013"></a>13.5.5. Installing score files</h3> </div> </div> @@ -10151,8 +10439,8 @@ user:group[:[userid][:[description][:[home][:shell]]]] <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634749" id= - "id2634749"></a>13.5.6. Packages providing + <h3 class="title"><a name="id2635057" id= + "id2635057"></a>13.5.6. Packages providing login shells</h3> </div> </div> @@ -10187,8 +10475,8 @@ user:group[:[userid][:[description][:[home][:shell]]]] <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634807" id= - "id2634807"></a>13.5.7. Packages containing + <h3 class="title"><a name="id2635114" id= + "id2635114"></a>13.5.7. Packages containing perl scripts</h3> </div> </div> @@ -10206,8 +10494,8 @@ user:group[:[userid][:[description][:[home][:shell]]]] <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634825" id= - "id2634825"></a>13.5.8. Packages with + <h3 class="title"><a name="id2635132" id= + "id2635132"></a>13.5.8. Packages with hardcoded paths to other interpreters</h3> </div> </div> @@ -10233,8 +10521,8 @@ user:group[:[userid][:[description][:[home][:shell]]]] <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2634846" id= - "id2634846"></a>13.5.9. Packages installing + <h3 class="title"><a name="id2635154" id= + "id2635154"></a>13.5.9. Packages installing perl modules</h3> </div> </div> @@ -10373,8 +10661,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2635134" id= - "id2635134"></a>13.5.11. Packages installing + <h3 class="title"><a name="id2635510" id= + "id2635510"></a>13.5.11. Packages installing GConf2 data files</h3> </div> </div> @@ -10448,8 +10736,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2635303" id= - "id2635303"></a>13.5.12. Packages installing + <h3 class="title"><a name="id2635678" id= + "id2635678"></a>13.5.12. Packages installing scrollkeeper data files</h3> </div> </div> @@ -10493,8 +10781,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2635354" id= - "id2635354"></a>13.5.13. Packages installing + <h3 class="title"><a name="id2635730" id= + "id2635730"></a>13.5.13. Packages installing X11 fonts</h3> </div> </div> @@ -10531,8 +10819,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2635469" id= - "id2635469"></a>13.5.14. Packages installing + <h3 class="title"><a name="id2635777" id= + "id2635777"></a>13.5.14. Packages installing GTK2 modules</h3> </div> </div> @@ -10598,8 +10886,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2635539" id= - "id2635539"></a>13.5.15. Packages installing + <h3 class="title"><a name="id2635846" id= + "id2635846"></a>13.5.15. Packages installing SGML or XML data</h3> </div> </div> @@ -10660,8 +10948,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2635659" id= - "id2635659"></a>13.5.16. Packages installing + <h3 class="title"><a name="id2635898" id= + "id2635898"></a>13.5.16. Packages installing extensions to the MIME database</h3> </div> </div> @@ -10719,8 +11007,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2635730" id= - "id2635730"></a>13.5.17. Packages using + <h3 class="title"><a name="id2636037" id= + "id2636037"></a>13.5.17. Packages using intltool</h3> </div> </div> @@ -10743,8 +11031,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2635744" id= - "id2635744"></a>13.5.18. Packages installing + <h3 class="title"><a name="id2636051" id= + "id2636051"></a>13.5.18. Packages installing startup scripts</h3> </div> </div> @@ -10767,7 +11055,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2635765" id="id2635765"></a>13.6. Feedback + "id2636072" id="id2636072"></a>13.6. Feedback to the author</h2> </div> </div> @@ -10890,7 +11178,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p>Look at the <code class= "filename">Makefile</code>, fix if necessary; see <a href="#components.Makefile" title= - "8.1. Makefile">Section 8.1, + "7.1. Makefile">Section 7.1, “<code class= "filename">Makefile</code>”</a>.</p> </li> @@ -11003,17 +11291,17 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2636227">15.1. + <dt><span class="sect1"><a href="#id2636739">15.1. Submitting your packages</a></span></dt> - <dt><span class="sect1"><a href="#id2636284">15.2. + <dt><span class="sect1"><a href="#id2636796">15.2. Committing: Importing a package into CVS</a></span></dt> - <dt><span class="sect1"><a href="#id2636484">15.3. + <dt><span class="sect1"><a href="#id2636859">15.3. Updating a package to a newer version</a></span></dt> - <dt><span class="sect1"><a href="#id2636503">15.4. + <dt><span class="sect1"><a href="#id2636878">15.4. Moving a package in pkgsrc</a></span></dt> </dl> </div> @@ -11023,8 +11311,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2636227" id= - "id2636227"></a>15.1. Submitting your + "id2636739" id= + "id2636739"></a>15.1. Submitting your packages</h2> </div> </div> @@ -11093,8 +11381,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2636284" id= - "id2636284"></a>15.2. Committing: Importing a + "id2636796" id= + "id2636796"></a>15.2. Committing: Importing a package into CVS</h2> </div> </div> @@ -11150,7 +11438,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2636484" id="id2636484"></a>15.3. Updating + "id2636859" id="id2636859"></a>15.3. Updating a package to a newer version</h2> </div> </div> @@ -11201,7 +11489,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2636503" id="id2636503"></a>15.4. Moving a + "id2636878" id="id2636878"></a>15.4. Moving a package in pkgsrc</h2> </div> </div> @@ -11302,27 +11590,27 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2636729">A.1. + <dt><span class="sect1"><a href="#id2637036">A.1. files</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2636732">A.1.1. + <dt><span class="sect2"><a href="#id2637040">A.1.1. Makefile</a></span></dt> - <dt><span class="sect2"><a href="#id2636740">A.1.2. + <dt><span class="sect2"><a href="#id2637047">A.1.2. DESCR</a></span></dt> - <dt><span class="sect2"><a href="#id2636755">A.1.3. + <dt><span class="sect2"><a href="#id2637062">A.1.3. PLIST</a></span></dt> - <dt><span class="sect2"><a href="#id2636762">A.1.4. + <dt><span class="sect2"><a href="#id2637069">A.1.4. Checking a package with <span><strong class= "command">pkglint</strong></span></a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2636803">A.2. Steps + <dt><span class="sect1"><a href="#id2637110">A.2. Steps for building, installing, packaging</a></span></dt> </dl> </div> @@ -11340,7 +11628,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2636729" id="id2636729"></a>A.1. files</h2> + "id2637036" id="id2637036"></a>A.1. files</h2> </div> </div> </div> @@ -11349,8 +11637,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2636732" id= - "id2636732"></a>A.1.1. Makefile</h3> + <h3 class="title"><a name="id2637040" id= + "id2637040"></a>A.1.1. Makefile</h3> </div> </div> </div> @@ -11377,8 +11665,8 @@ INFO_FILES= bison.info <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2636740" id= - "id2636740"></a>A.1.2. DESCR</h3> + <h3 class="title"><a name="id2637047" id= + "id2637047"></a>A.1.2. DESCR</h3> </div> </div> </div> @@ -11394,8 +11682,8 @@ of the NetBSD source tree is beyond me. <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2636755" id= - "id2636755"></a>A.1.3. PLIST</h3> + <h3 class="title"><a name="id2637062" id= + "id2637062"></a>A.1.3. PLIST</h3> </div> </div> </div> @@ -11412,8 +11700,8 @@ share/bison.hairy <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2636762" id= - "id2636762"></a>A.1.4. Checking a package with + <h3 class="title"><a name="id2637069" id= + "id2637069"></a>A.1.4. Checking a package with <span><strong class= "command">pkglint</strong></span></h3> </div> @@ -11447,7 +11735,7 @@ looks fine. <div> <div> <h2 class="title" style="clear: both"><a name= - "id2636803" id="id2636803"></a>A.2. Steps for + "id2637110" id="id2637110"></a>A.2. Steps for building, installing, packaging</h2> </div> </div> @@ -11469,8 +11757,8 @@ looks fine. <p>Create <code class="filename">Makefile</code>, <code class="filename">DESCR</code> and <code class= "filename">PLIST</code> (see <a href="#components" title= - "Chapter 8. Package components - files, directories and contents"> - Chapter 8, <i>Package components - files, directories and + "Chapter 7. Package components - files, directories and contents"> + Chapter 7, <i>Package components - files, directories and contents</i></a>) then continue with fetching the distfile:</p> <pre class="screen"> @@ -11865,10 +12153,10 @@ Registering depends:. <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2637654">D.1. + <dt><span class="sect1"><a href="#id2637893">D.1. Targets</a></span></dt> - <dt><span class="sect1"><a href="#id2637856">D.2. + <dt><span class="sect1"><a href="#id2637958">D.2. Procedure</a></span></dt> </dl> </div> @@ -11881,7 +12169,7 @@ Registering depends:. <div> <div> <h2 class="title" style="clear: both"><a name= - "id2637654" id="id2637654"></a>D.1. Targets</h2> + "id2637893" id="id2637893"></a>D.1. Targets</h2> </div> </div> </div> @@ -11932,8 +12220,8 @@ Registering depends:. <div> <div> <h2 class="title" style="clear: both"><a name= - "id2637856" id= - "id2637856"></a>D.2. Procedure</h2> + "id2637958" id= + "id2637958"></a>D.2. Procedure</h2> </div> </div> </div> diff --git a/doc/pkgsrc.txt b/doc/pkgsrc.txt index 7d4991f29c5..387fc55f0d6 100644 --- a/doc/pkgsrc.txt +++ b/doc/pkgsrc.txt @@ -14,7 +14,7 @@ The pkgsrc Developers Copyright (C) 1994-2004 The NetBSD Foundation, Inc -$NetBSD: pkgsrc.xml,v 1.5 2005/05/10 00:27:43 rillig Exp $ +$NetBSD: pkgsrc.xml,v 1.6 2005/05/15 20:32:27 rillig Exp $ Abstract @@ -109,24 +109,29 @@ I. The pkgsrc user's guide II. The pkgsrc developer's guide - 7. Programming in Makefiles + 7. Package components - files, directories and contents - 7.1. Makefile variables - 7.2. Code snippets + 7.1. Makefile + 7.2. distinfo + 7.3. patches/* + 7.4. Other mandatory files + 7.5. Optional files + 7.6. work* + 7.7. files/* - 7.2.1. Adding things to a list - 7.2.2. Converting an internal list into an external list - 7.2.3. Passing variables to a shell command + 8. Programming in Makefiles - 8. Package components - files, directories and contents + 8.1. Makefile variables - 8.1. Makefile - 8.2. distinfo - 8.3. patches/* - 8.4. Other mandatory files - 8.5. Optional files - 8.6. work* - 8.7. files/* + 8.1.1. Naming conventions + + 8.2. Code snippets + + 8.2.1. Adding things to a list + 8.2.2. Converting an internal list into an external list + 8.2.3. Passing variables to a shell command + 8.2.4. Quoting guideline + 8.2.5. Workaround for a bug in BSD Make 9. PLIST issues @@ -343,8 +348,9 @@ Package The NetBSD package system This is the former name of "pkgsrc". It is part of the NetBSD operating - system and can be bootstrap to run on non-NetBSD operating systems as well. - It handles building (compiling), installing, and removing of packages. + system and can be bootstrapped to run on non-NetBSD operating systems as + well. It handles building (compiling), installing, and removing of + packages. Distfile @@ -379,7 +385,7 @@ Program When giving examples for commands, shell prompts are used to show if the command should/can be issued as root, or if "normal" user privileges are -sufficient. We use a # for root's shell prompt, and a $ for users' shell +sufficient. We use a # for root's shell prompt, and a % for users' shell prompt, assuming they use the C-shell or tcsh. The pkgsrc user's guide @@ -485,9 +491,8 @@ pkgsrc directory exists. Then, simply run sup -v /path/to/your/supfile. 2.3. Via CVS -To get pkgsrc via CVS, make sure you have "cvs" installed. If not present on -your system, it can be found as precompiled binary on ftp.NetBSD.org. To do an -initial (full) checkout of pkgsrc, do the following steps: +To get pkgsrc via CVS, make sure you have "cvs" installed. To do an initial +(full) checkout of pkgsrc, do the following steps: % setenv CVSROOT anoncvs@anoncvs.NetBSD.org:/cvsroot % setenv CVS_RSH ssh @@ -522,7 +527,7 @@ Table of Contents 3.1. Bootstrapping pkgsrc -For Operating Systems other than NetBSD, we provide a bootstrap kit to build +For operating systems other than NetBSD, we provide a bootstrap kit to build the required tools to use pkgsrc on your platform. Besides support for native NetBSD, pkgsrc and the bootstrap kit have support for the following operating systems: @@ -556,8 +561,8 @@ Installing the bootstrap kit should be as simple as: See Chapter 2, Where to get pkgsrc for other ways to get pkgsrc before bootstrapping. The given bootstrap command will use the defaults of /usr/pkg for the prefix where programs will be installed in, and /var/db/pkg for the -package database directory where pkgsrc will do it's internal bookkeeping. -However, these can also be set using command-line parameters. +package database directory where pkgsrc will do its internal bookkeeping. +However, these can also be set using command-line arguments. Binary packages for the pkgsrc tools and an initial set of packages is available for supported platforms. An up-to-date list of these can be found on @@ -752,9 +757,9 @@ Please note that you will need IRIX 6.5.17 or higher, as this is the earliest version of IRIX providing support for if_indextoname(3), if_nametoindex(3), etc. -At this point in time, pkgsrc only supports one ABI. That is, you can not -switch between the old 32-bit ABI, the new 32-bit ABI and the 64-bit ABI. If -you start out using "abi=n32", that's what all your packages will be built +At this point in time, pkgsrc only supports one ABI at a time. That is, you can +not switch between the old 32-bit ABI, the new 32-bit ABI and the 64-bit ABI. +If you start out using "abi=n32", that's what all your packages will be built with. Therefore, please make sure that you have no conflicting CFLAGS in your @@ -769,7 +774,7 @@ filesystem. The bootstrapping process should set all the right options for programs such as imake(1), but you may want to set some options depending on your local setup. -Please see pkgsrc/mk/defaults/mk.conf and, of course, your compilers man pages +Please see pkgsrc/mk/defaults/mk.conf and, of course, your compiler's man pages for details. If you are using SGI's MIPSPro compiler, please set @@ -907,7 +912,7 @@ You will need at least the following packages installed (from WorkShop 5.0) You should set CC, CXX and optionally, CPP in /etc/mk.conf, eg. -CC= cc +CC= cc CXX= CC CPP= /usr/ccs/lib/cpp @@ -943,11 +948,12 @@ package that someone else already prepared for your type of machine. 4.1.1. Where to get binary packages Precompiled packages are stored on ftp.NetBSD.org and its mirrors in the -directory /pub/NetBSD/packages for anonymous FTP access. Please pick the right -subdirectory there as indicated by uname -p. In that directory, there is a -subdirectory for each category plus a subdirectory All which includes the -actual binaries in .tgz files. The category subdirectories use symbolic links -to those files (this is the same directory layout as in /usr/pkgsrc/packages). +directory /pub/NetBSD/packages/<OSVERSION>/<ARCH>/ for anonymous FTP access. +OSVERSION is the NetBSD version (uname -r), ARCH is the architecture (uname -p +). In that directory, there is a subdirectory for each category plus a +subdirectory All which includes the actual binaries in .tgz files. The category +subdirectories use symbolic links to those files (this is the same directory +layout as in /usr/pkgsrc/packages). This same directory layout applies for CDROM distributions, only that the directory may be rooted somewhere else, probably somewhere below /cdrom. Please @@ -956,7 +962,7 @@ consult your CDROMs documentation for the exact location. 4.1.2. How to use binary packages If you have the files on a CDROM or downloaded them to your hard disk, you can -install them with the following command (be sure tosu to root first): +install them with the following command (be sure to su to root first): # pkg_add /path/to/package.tgz @@ -964,13 +970,10 @@ If you have FTP access and you don't want to download the packages via FTP prior to installation, you can do this automatically by giving pkg_add an FTP URL: -# pkg_add ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSvers>/<arch>/All/package.tgz +# pkg_add ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/All/package.tgz -If there is any doubt, the uname utility can be used to determine the <OSvers>, -and <arch> by running uname -rp. - -Also note that any prerequisite packages needed to run the package in question -will be installed, too, assuming they are present where you install from. +Note that any prerequisite packages needed to run the package in question will +be installed, too, assuming they are present where you install from. To save some typing, you can set the PKG_PATH environment variable to a semicolon separated list of paths (including remote URLs); trailing slashes are @@ -982,12 +985,13 @@ cause missing dependencies. To use these packages, add the vulnerable directory to your PKG_PATH. However, you should run security/audit-packages regularly, and especially after installing new packages, and verify that the vulnerabilities are acceptable for your configuration. An example PKG_PATH -would be: ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSvers>/<arch>/All;ftp:// -ftp.NetBSD.org/pub/NetBSD/packages/<OSvers>/<arch>/vulnerable Please note that -semicolon (';') is a shell meta-character, so you'll probably have to quote it. +would be: ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/All;ftp:/ +/ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/vulnerable Please note +that semicolon (';') is a shell meta-character, so you'll probably have to +quote it. -After you've installed packages, be sure to have /usr/pkg/bin in your PATH so -you can actually start the just installed program. +After you've installed packages, be sure to have /usr/pkg/bin and /usr/pkg/sbin +in your PATH so you can actually start the just installed program. 4.1.3. A word of warning @@ -999,7 +1003,8 @@ your system by indiscriminate adding of such files. 4.2. Building packages from source This assumes that the package is already in pkgsrc. If it is not, see Part II, -"The pkgsrc developer's guide". +"The pkgsrc developer's guide" for instructions how to create your own +packages. 4.2.1. Requirements @@ -1009,13 +1014,13 @@ the "xbase" and "xcomp" distribution sets are required, too. 4.2.2. Fetching distfiles -The distfile (i.e. the unmodified source) must exist on your system for the -packages system to be able to build it. If it does not exist, pkgsrc will use -ftp(1) to fetch it automatically. +The first step for building a package is downloading the distfiles (i.e. the +unmodified source). If they have not yet been downloaded, pkgsrc will fetch +them automatically. You can overwrite some of the major distribution sites to fit to sites that are close to your own. Have a look at pkgsrc/mk/defaults/mk.conf to find some -examples - in particular, look for the MASTER_SORT, MASTER_SORT_REGEX and +examples ? in particular, look for the MASTER_SORT, MASTER_SORT_REGEX and INET_COUNTRY definitions. This may save some of your bandwidth and time. You can change these settings either in your shell's environment, or, if you @@ -1599,9 +1604,9 @@ Utilities used by pkgsrc (automatically installed when needed): OS tool augmentation (automatically installed when needed): - * pkgtools/digest: calculates SHA1 checksums (and other kinds) + * pkgtools/digest: calculates various kinds of checksums (including SHA1) - * pkgtools/libnbcompat: compat library for pkg tools + * pkgtools/libnbcompat: compatibility library for pkgsrc tools * pkgtools/mtree: installed on non-BSD systems due to lack of native mtree @@ -1611,7 +1616,7 @@ OS tool augmentation (automatically installed when needed): Utilities used by pkgsrc (not automatically installed): * pkgtools/pkg_tarup: create a binary package from an already-installed - package. used by 'make replace' to save the old package + package. used by make replace to save the old package * pkgtools/dfdisk: adds extra functionality to pkgsrc, allowing it to fetch distfiles from multiple locations. It currently supports the following @@ -1624,17 +1629,17 @@ Utilities used by pkgsrc (not automatically installed): Utilities for keeping track of installed packages, being up to date, etc: - * pkgtools/pkg_chk: installs pkg_chk, which reports on packages whose - installed versions do not match the latest pkgsrc entries + * pkgtools/pkg_chk: reports on packages whose installed versions do not match + the latest pkgsrc entries * pkgtools/pkgdep: makes dependency graphs of packages, to aid in choosing a strategy for updating - * pkgtools/pkgdepgraph: make graph from above (uses graphviz) + * pkgtools/pkgdepgraph: makes graphs from the output of pkgtools/pkgdep (uses + graphviz) - * pkgtools/pkglint: This provides two distinct abilities: check a pkgsrc - entry for correctness (pkglint) check for and remove out-of-date distfiles - and binary packages (lintpkgsrc) + * pkgtools/pkglint: the pkglint(1) program checks a pkgsrc entry for errors, + lintpkgsrc(1) does various checks on the complete pkgsrc system. * pkgtools/pkgsurvey: report what packages you have installed @@ -1675,11 +1680,9 @@ For example, if you want to use wget to resume downloads, you'll have to use something like: FETCH_CMD=wget - .if defined(FETCH_CMD) && ${FETCH_CMD} == "wget" FETCH_BEFORE_ARGS=--passive-ftp FETCH_RESUME_ARGS=-c FETCH_OUTPUT_ARGS=-O - .endif 6.6. How can I install/use XFree86 from pkgsrc? @@ -1889,24 +1892,29 @@ The pkgsrc developer's guide Table of Contents -7. Programming in Makefiles +7. Package components - files, directories and contents + + 7.1. Makefile + 7.2. distinfo + 7.3. patches/* + 7.4. Other mandatory files + 7.5. Optional files + 7.6. work* + 7.7. files/* + +8. Programming in Makefiles - 7.1. Makefile variables - 7.2. Code snippets + 8.1. Makefile variables - 7.2.1. Adding things to a list - 7.2.2. Converting an internal list into an external list - 7.2.3. Passing variables to a shell command + 8.1.1. Naming conventions -8. Package components - files, directories and contents + 8.2. Code snippets - 8.1. Makefile - 8.2. distinfo - 8.3. patches/* - 8.4. Other mandatory files - 8.5. Optional files - 8.6. work* - 8.7. files/* + 8.2.1. Adding things to a list + 8.2.2. Converting an internal list into an external list + 8.2.3. Passing variables to a shell command + 8.2.4. Quoting guideline + 8.2.5. Workaround for a bug in BSD Make 9. PLIST issues @@ -2005,146 +2013,22 @@ Table of Contents 15.3. Updating a package to a newer version 15.4. Moving a package in pkgsrc -Chapter 7. Programming in Makefiles +Chapter 7. Package components - files, directories and contents Table of Contents -7.1. Makefile variables -7.2. Code snippets - - 7.2.1. Adding things to a list - 7.2.2. Converting an internal list into an external list - 7.2.3. Passing variables to a shell command - -WARNING: The make(1) man page is wrong. After the man page has been corrected, -this chapter will be updated. Until that, don't take it too serious. - -Pkgsrc consists of many Makefile fragments, each of which forms a well-defined -part of the pkgsrc system. Using the make(1) system as a programming language -for a big system like pkgsrc requires some discipline to keep the code correct -and understandable. - -The basic ingredients for Makefile programming are variables (which are -actually macros) and shell commands. Among these shell commands may even be -more complex ones like awk(1) programs. To make sure that every shell command -runs as intended it is necessary to quote all variables correctly when they are -used. - -This chapter describes some patterns, that appear quite often in Makefiles, -including the pitfalls that come along with them. - -7.1. Makefile variables - -A restriction common to all types of variables is that they can neither contain -a newline character nor the '\0' character nor the '#' character. The effects -of the backslash character are not documented, so you should not use it at the -moment. As the $ is used to get values of a Makefile variable, it must be -quoted as $$. - -There are several types of variables that must be handled differently. - - * Simple values (which I will call atoms) can contain any string, which does - not have to be quoted in any way. All other types are somewhat restricted - in their possible values. - - * Internal lists are lists that are never exported to any shell command. - Their elements are separated by whitespace. Therefore the elements - themselves cannot have embedded whitespace. Any other characters are - allowed. Internal lists can be used in .for loops. Examples are DEPENDS, - BUILD_DEPENDS. - - * External lists are lists that may be exported to a shell command. Their - elements can contain any characters, including whitespace. That's why they - cannot be used in .for loops. Examples are DISTFILES and MASTER_SITES. - -7.2. Code snippets - -This section presents you with some code snippets you should use in your own -code. If you don't find anything appropriate here, you should test your code -and add it here. - -7.2.1. Adding things to a list - -ATOM= foo * bar `date` -INT_LIST= # empty -ANOTHER_INT_LIST= apache-[0-9]*:../../www/apache -EXT_LIST= # empty -ANOTHER_EXT_LIST= a=b c=d - -INT_LIST+= ${ATOM} # 1 -INT_LIST+= ${ANOTHER_INT_LIST} # 2 -EXT_LIST+= ${ATOM:Q} # 3 -EXT_LIST+= ${ANOTHER_EXT_LIST} # 4 - - -When you add an atom to an external list (example 3), it must be quoted. In all -other cases, you must not add a quoting level. You must not merge internal and -external lists, unless you are sure that all entries are correctly interpreted -in both lists. - -7.2.2. Converting an internal list into an external list - -EXT_LIST= # empty -.for i in ${INT_LIST} -EXT_LIST+= ${i:Q} -.endfor - - -This code converts the internal list INT_LIST into the external list EXT_LIST. -As the elements of an internal list are unquoted they must be quoted here. - -7.2.3. Passing variables to a shell command - -ATOM= foo bar < > * `date` $$HOME ' " -EXT_LIST= atom=${ATOM:Q} x=second\ item - -all: - echo ${ATOM} # 1 - echo "${ATOM}" # 2 - echo "${ATOM:Q}" # 3 - echo ${ATOM:Q} # 4 - echo x${ATOM:Q} | sed 1s,.,, # 5 - env ${EXT_LIST} /bin/sh -c 'echo "$$atom"; echo "$$x"' - - -Example 1 leads to a syntax error in the shell, as the characters are just -copied. - -Example 2 leads to a syntax error too, and if you leave out the last " -character from ${ATOM}, date(1) would be executed. The $HOME shell variable -would be evaluated, too. - -Example 3 would output each space character preceded by a backslash (or not), -depending on the implementation of the echo(1) command. - -Example 4 handles correctly every string that does not start with a dash. In -that case, the result depends on the implementation of the echo(1) command. As -long as you can guarantee that your input does not start with a dash this form -is appropriate. - -Example 5 handles even the case of a leading dash correctly. - -The EXT_LIST does not need to be quoted because the quoting has already be done -when adding elements to the list. - -As internal lists shall not be passed to the shell, there is no example for it. - -Chapter 8. Package components - files, directories and contents - -Table of Contents - -8.1. Makefile -8.2. distinfo -8.3. patches/* -8.4. Other mandatory files -8.5. Optional files -8.6. work* -8.7. files/* +7.1. Makefile +7.2. distinfo +7.3. patches/* +7.4. Other mandatory files +7.5. Optional files +7.6. work* +7.7. files/* Whenever you're preparing a package, there are a number of files involved which are described in the following sections. -8.1. Makefile +7.1. Makefile Building, installation and creation of a binary package are all controlled by the package's Makefile. The Makefile describes various things about a package, @@ -2160,7 +2044,10 @@ exactly in the order given here. * PKGNAME is the name of the package, as used by pkgsrc. You only need to provide it if it differs from DISTNAME. Usually it is the directory name - together with the version number. + together with the version number. It must match the regular expression ^ + [A-Za-z0-9][A-Za-z0-9-_.+]*$, that is, it starts with a letter or digit, + and contains only letters, digits, dashes, underscores, dots and plus + signs. * CATEGORIES is a list of categories which the package fits in. You can choose any of the top-level directories of pkgsrc for it. @@ -2180,21 +2067,27 @@ The second section contains the following variables. The MASTER_SITES may be set to one of the predefined sites: ${MASTER_SITE_APACHE} + ${MASTER_SITE_BACKUP} + ${MASTER_SITE_CYGWIN} ${MASTER_SITE_DEBIAN} + ${MASTER_SITE_FREEBSD} + ${MASTER_SITE_FREEBSD_LOCAL} ${MASTER_SITE_GNOME} ${MASTER_SITE_GNU} ${MASTER_SITE_GNUSTEP} ${MASTER_SITE_IFARCHIVE} ${MASTER_SITE_MOZILLA} + ${MASTER_SITE_OPENOFFICE} ${MASTER_SITE_PERL_CPAN} + ${MASTER_SITE_R_CRAN} ${MASTER_SITE_SOURCEFORGE} ${MASTER_SITE_SUNSITE} - ${MASTER_SITE_R_CRAN} ${MASTER_SITE_SUSE} ${MASTER_SITE_TEX_CTAN} ${MASTER_SITE_XCONTRIB} ${MASTER_SITE_XEMACS} + If one of these predefined sites is chosen, you may require the ability to specify a subdirectory of that site. Since these macros may expand to more than one actual site, you must use the following construct to specify a @@ -2253,7 +2146,7 @@ Please pay attention to the following gotchas: * Be sure to set the COMMENT variable to a short description of the package, not containing the pkg's name. -8.2. distinfo +7.2. distinfo Most important, the mandatory message digest, or checksum, of all the distfiles needed for the package to compile, confirming they match the original file @@ -2273,12 +2166,12 @@ should be taken when upgrading such a package to ensure distfile information is not lost. The message digest/checksum for all the official patches found in the patches/ -directory (see Section 8.3, "patches/*") for the package is also stored in the +directory (see Section 7.3, "patches/*") for the package is also stored in the distinfo file. This is a message digest/checksum of all lines in the patch file except the NetBSD RCS Id. This file is generated by invoking make makepatchsum (or make mps if you're in a hurry). -8.3. patches/* +7.3. patches/* This directory contains files that are used by the patch(1) command to modify the sources as distributed in the distribution file into a form that will @@ -2309,7 +2202,7 @@ easily compare the new set of patches with the previously existing one with patchdiff. When you have finished a package, remember to generate the checksums for the -patch files by using the make makepatchsum command, see Section 8.2, "distinfo" +patch files by using the make makepatchsum command, see Section 7.2, "distinfo" . Patch files that are distributed by the author or other maintainers can be @@ -2324,7 +2217,7 @@ pkgsrc/graphics/png, keep it in $LOCALPATCHES/graphics/png/mypatch. All files in the named directory are expected to be patch files, and they are applied after pkgsrc patches are applied. -8.4. Other mandatory files +7.4. Other mandatory files DESCR @@ -2341,7 +2234,7 @@ PLIST and the location of inserted files. See Chapter 9, PLIST issues for more information. -8.5. Optional files +7.5. Optional files INSTALL @@ -2371,7 +2264,7 @@ MESSAGE replaces "${SOMEVAR}" with "somevalue" in MESSAGE. -8.6. work* +7.6. work* When you type make the distribution files are unpacked into this directory. It can be removed by running make clean. Besides the sources, this directory is @@ -2381,7 +2274,7 @@ If a package doesn't create a subdirectory for itself (like GNU software does, for instance), but extracts itself in the current directory, you should set WRKSRC accordingly, e.g. editors/sam again, but the quick answer is: -WRKSRC= ${WRKDIR} +WRKSRC= ${WRKDIR} Please note that the old NO_WRKSUBDIR has been deprecated and should not be used. Also, if your package doesn't create a subdir with the name of DISTNAME @@ -2395,7 +2288,7 @@ same pkgsrc tree should be used on several different platforms, the variable OBJMACHINE can be set in /etc/mk.conf to attach the platform to the directory name, e.g. work.i386 or work.sparc. -8.7. files/* +7.7. files/* If you have any files that you wish to be placed in the package prior to configuration or building, you could place these files here and use a "${CP}" @@ -2403,6 +2296,250 @@ command in the "pre-configure" target to achieve this. Alternatively, you could simply diff the file against /dev/null and use the patch mechanism to manage the creation of this file. +Chapter 8. Programming in Makefiles + +Table of Contents + +8.1. Makefile variables + + 8.1.1. Naming conventions + +8.2. Code snippets + + 8.2.1. Adding things to a list + 8.2.2. Converting an internal list into an external list + 8.2.3. Passing variables to a shell command + 8.2.4. Quoting guideline + 8.2.5. Workaround for a bug in BSD Make + +Pkgsrc consists of many Makefile fragments, each of which forms a well-defined +part of the pkgsrc system. Using the make(1) system as a programming language +for a big system like pkgsrc requires some discipline to keep the code correct +and understandable. + +The basic ingredients for Makefile programming are variables (which are +actually macros) and shell commands. Among these shell commands may even be +more complex ones like awk(1) programs. To make sure that every shell command +runs as intended it is necessary to quote all variables correctly when they are +used. + +This chapter describes some patterns, that appear quite often in Makefiles, +including the pitfalls that come along with them. + +8.1. Makefile variables + +Makefile variables contain strings that can be processed using the five +operators ``='', ``+='', ``?='', ``:='', and ``!='', which are described in the +make(1) man page. + +When a variable's value is parsed from a Makefile, the hash character ``#'' and +the backslash character ``\'' are handled specially. If a backslash is followed +by a newline, any whitespace immediately in front of the backslash, the +backslash, the newline, and any whitespace immediately behind the newline are +replaced with a single space. A backspace character and an immediately +following hash character are replaced with a single hash character. Otherwise +the backslash is passed as is. In a variable assignment, any hash character +that is not preceded by a backslash starts a comment that continues upto the +end of the logical line. + +Note: Because of this parsing algorithm the only way to create a variable +consisting of a single backslash is using the ``!='' operator, for example: +BACKSLASH!=echo "\\". + +So far for defining variables. The other thing you can do with variables is +evaluating them. A variable is evaluated when it is part of the right side of +the ``:='' or the ``!='' operator, or directly before executing a shell command +which the variable is part of. In all other cases make(1) performs lazy +evaluation, that is, variables are not evaluated until there's no other way. +The ``modifiers'' mentioned in the man page also evaluate the variable. + +Some of the modifiers split the string into words and then operate on the +words, others operate on the string as a whole. When a string is splitted into +words, it is splitted as you would expect it from sh(1). + +No rule without exception?the .for loop does not follow the shell quoting rules +but splits at sequences of whitespace. + +There are several types of variables that should be handled differently. +Strings and two types of lists. + + * Strings can contain arbitrary characters. Nevertheless you should restrict + yourself to only using printable characters. Examples are PREFIX and + COMMENT. + + * Internal lists are lists that are never exported to any shell command. + Their elements are separated by whitespace. Therefore the elements + themselves cannot have embedded whitespace. Any other characters are + allowed. Internal lists can be used in .for loops. Examples are DEPENDS and + BUILD_DEPENDS. + + * External lists are lists that may be exported to a shell command. Their + elements can contain any characters, including whitespace. That's why they + cannot be used in .for loops. Examples are DISTFILES and MASTER_SITES. + +8.1.1. Naming conventions + + * All variable names starting with an underscore are reserved for use by the + pkgsrc infrastructure. They shall not be used by package Makefiles. + + * In .for loops you should use lowercase variable names for the iteration + variables. + + * All list variables should have a ``plural'' name, e.g. PKG_OPTIONS or + DISTFILES. + +8.2. Code snippets + +This section presents you with some code snippets you should use in your own +code. If you don't find anything appropriate here, you should test your code +and add it here. + +8.2.1. Adding things to a list + +STRING= foo * bar `date` +INT_LIST= # empty +ANOTHER_INT_LIST= apache-[0-9]*:../../www/apache +EXT_LIST= # empty +ANOTHER_EXT_LIST= a=b c=d + +INT_LIST+= ${STRING} # 1 +INT_LIST+= ${ANOTHER_INT_LIST} # 2 +EXT_LIST+= ${STRING:Q} # 3 +EXT_LIST+= ${ANOTHER_EXT_LIST} # 4 + + +When you add a string to an external list (example 3), it must be quoted. In +all other cases, you must not add a quoting level. You must not merge internal +and external lists, unless you are sure that all entries are correctly +interpreted in both lists. + +8.2.2. Converting an internal list into an external list + +EXT_LIST= # empty +.for i in ${INT_LIST} +EXT_LIST+= ${i:Q}"" +.endfor + + +This code converts the internal list INT_LIST into the external list EXT_LIST. +As the elements of an internal list are unquoted they must be quoted here. The +reason for appending "" is explained below. + +8.2.3. Passing variables to a shell command + +STRING= foo bar < > * `date` $$HOME ' " +EXT_LIST= string=${STRING:Q} x=second\ item + +all: + echo ${STRING} # 1 + echo "${STRING}" # 2 + echo "${STRING:Q}" # 3 + echo ${STRING:Q} # 4 + echo x${STRING:Q} | sed 1s,.,, # 5 + env ${EXT_LIST} /bin/sh -c 'echo "$$string"; echo "$$x"' + + +Example 1 leads to a syntax error in the shell, as the characters are just +copied. + +Example 2 leads to a syntax error too, and if you leave out the last " +character from ${STRING}, date(1) will be executed. The $HOME shell variable +would be evaluated, too. + +Example 3 outputs each space character preceded by a backslash (or not), +depending on the implementation of the echo(1) command. + +Example 4 handles correctly every string that does not start with a dash. In +that case, the result depends on the implementation of the echo(1) command. As +long as you can guarantee that your input does not start with a dash this form +is appropriate. + +Example 5 handles even the case of a leading dash correctly. + +The EXT_LIST does not need to be quoted because the quoting has already be done +when adding elements to the list. + +As internal lists shall not be passed to the shell, there is no example for it. + +8.2.4. Quoting guideline + +There are many possible sources of wrongly quoted variables. This section lists +some of the commonly known ones. + + * Whenever you use the value of a list, think about what happens to leading + or trailing whitespace. If the list is a well-formed shell expression you + can apply the :M* modifier to strip leading and trailing whitespace from + each word. The :M operator first splits its argument according to the rules + of the shell, and then creates a new list consisting of all words that + match the shell glob expression *, that is: all. One class of situations + where this is needed is when adding a variable like CPPFLAGS to + CONFIGURE_ARGS. If the configure script invokes other configure scripts it + strips the leading and trailing whitespace from the variable and then + passes it to the other configure scripts. But these configure scripts + expect the (child) CPPFLAGS variable to be the same as the parent CPPFLAGS. + That's why we better pass the CPPFLAGS value properly trimmed. And here is + how we do it: + + CPPFLAGS= # empty + CPPFLAGS+= -Wundef -DPREFIX=\"${PREFIX:Q}\" + CPPFLAGS+= ${MY_CPPFLAGS} + + CONFIGURE_ARGS+= CPPFLAGS=${CPPFLAGS:M*:Q} + + all: + echo x${CPPFLAGS:Q}x # leading and trailing whitespace + echo x${CONFIGURE_ARGS}x # properly trimmed + + + * The example above contains one bug: The ${PREFIX} is a properly quoted + shell expression, but there is the C compiler after it, which also expects + a properly quoted string (this time in C syntax). The version above is + therefore only correct if ${PREFIX} does not have embedded backslashes or + double quotes. If you want to allow these, you have to add another layer of + quoting to each variable that is used as a C string literal. You cannot use + the :Q operator for it, as this operator only works for the shell. + + * Whenever a variable can be empty the :Q operator can have surprising + results. Here are two completely different cases which can be solved with + the same trick. + + EMPTY= # empty + empty_test: + for i in a ${EMPTY:Q} c; do \ + echo "$$i"; \ + done + + for_test: + .for i in a:\ a:\test.txt + echo ${i:Q} + echo "foo" + .endfor + + + The first example will only print two of the three lines we might have + expected. This is because ${EMPTY:Q} expands to the empty string, which the + shell cannot see. The workaround is to write ${EMPTY:Q}"". This pattern can + be often found as ${TEST} -z ${VAR:Q} or as ${TEST} -f ${FNAME:Q} (both of + these are wrong). + + The second example will only print three lines instead of four. The first + line looks like a:\ echo foo. This is because the backslash of the value a: + \ is interpreted as a line-continuation by make(1), which makes the second + line the arguments of the echo(1) command from the first line. To avoid + this, write ${i:Q}"". + +8.2.5. Workaround for a bug in BSD Make + +The pkgsrc bmake program does not handle the following assignment correctly. In +case _othervar_ contains a ``-'' character, one of the closing braces is +included in ${VAR} after this code executes. + + VAR:= ${VAR:N${_othervar_:C/-//}} + + +For a more complex code snippet and a workaround, see the package regress/ +make-quoting, testcase bug1. + Chapter 9. PLIST issues Table of Contents @@ -2502,7 +2639,7 @@ bsd.pkg.mk (and search for PLIST_SUBST). If you want to change other variables not listed above, you can add variables and their expansions to this variable in the following way, similar to -MESSAGE_SUBST (see Section 8.5, "Optional files"): +MESSAGE_SUBST (see Section 7.5, "Optional files"): PLIST_SUBST+= SOMEVAR="somevalue" @@ -2642,7 +2779,7 @@ The process of converting packages to use the buildlink3 framework If a dependency on a particular package is required for its libraries and headers, then we replace: -DEPENDS+= foo>=1.1.0:../../category/foo +DEPENDS+= foo>=1.1.0:../../category/foo with @@ -2944,26 +3081,16 @@ supported. This variable should be set in /etc/mk.conf. 11.2. Converting packages to use bsd.options.mk -The following example shows how bsd.options.mk should be used in a package -Makefile, or in a file, e.g. options.mk, that is included by the main package -Makefile. +The following example shows how bsd.options.mk should be used by the +hypothetical ``wibble'' package, either in the package Makefile, or in a file, +e.g. options.mk, that is included by the main package Makefile. # Global and legacy options -.if defined(WIBBLE_USE_OPENLDAP) && !empty(WIBBLE_USE_OPENLDAP:M[yY][eE][sS]) -PKG_DEFAULT_OPTIONS+= ldap -.endif -.if defined(USE_SASL2) && !empty(USE_SASL2:M[yY][eE][sS]) -PKG_DEFAULT_OPTIONS+= sasl -.endif - PKG_OPTIONS_VAR= PKG_OPTIONS.wibble PKG_SUPPORTED_OPTIONS= ldap sasl -# -# Default options for "wibble" package. -# -.if !defined(PKG_OPTIONS.wibble) -PKG_DEFAULT_OPTIONS+= sasl -endif +PKG_SUGGESTED_OPTIONS= sasl +PKG_OPTION_LEGACY_VARS= WIBBLE_USE_OPENLDAP:ldap USE_SASL2:sasl + .include "../../mk/bsd.options.mk" # Package-specific option-handling @@ -2993,17 +3120,20 @@ be removed over time as the old options are in turn deprecated and removed. The second section contains the information about which build options are supported by the package, and any default options settings if needed. - 1. PKG_OPTIONS_VAR is a list of the name of the make(1) variables that contain - the options the user wishes to select. The recommended value is - "PKG_OPTIONS.pkg" but any package-specific value may be used. This variable - should be set in a package Makefile. + 1. PKG_OPTIONS_VAR is the name of the make(1) variable that contains the + options the user wishes to select. The recommended value is "PKG_OPTIONS. + pkg" but any package-specific value may be used. This variable should be + set in a package Makefile. 2. PKG_SUPPORTED_OPTIONS is a list of build options supported by the package. This variable should be set in a package Makefile. - 3. ${PKG_OPTIONS_VAR} (the variables named in PKG_OPTIONS_VAR) are variables - that list the selected build options and override any default options given - in PKG_DEFAULT_OPTIONS. If any of the options begin with a "-", then that + 3. PKG_SUGGESTED_OPTIONS is a list of build options which are enabled by + default. + + 4. ${PKG_OPTIONS_VAR} (the variable named in PKG_OPTIONS_VAR) lists the + selected build options and overrides any default options given in + PKG_DEFAULT_OPTIONS. If any of the options begin with a "-", then that option is always removed from the selected build options, e.g. PKG_DEFAULT_OPTIONS= kerberos ldap sasl @@ -3058,7 +3188,7 @@ The automatic variable PREFIX indicates where all files of the final program shall be installed. It is usually set to LOCALBASE (/usr/pkg), or CROSSBASE for pkgs in the "cross" category. The value of PREFIX needs to be put into the various places in the program's source where paths to these files are encoded. -See Section 8.3, "patches/*" and Section 13.3.1, "Shared libraries - libtool" +See Section 7.3, "patches/*" and Section 13.3.1, "Shared libraries - libtool" for more details. When choosing which of these variables to use, follow the following rules: @@ -3183,7 +3313,7 @@ patch $PKGPATH (e.g. /usr/local/patches/graphics/png) are applied. Patchfiles ending in .Z or .gz are uncompressed before they are applied, files ending in .orig or .rej are ignored. Any special options to patch(1) can be handed - in PATCH_DIST_ARGS. See Section 8.3, "patches/*" for more details. + in PATCH_DIST_ARGS. See Section 7.3, "patches/*" for more details. By default patch(1) is given special args to make it fail if the patches apply with some lines of fuzz. Please fix (regen) the patches so that they @@ -4476,7 +4606,7 @@ what was explained in the previous sections, only with some debugging aids. shouldn't be, especially during the build phase. mkpatches, patchdiff and pkgvi are from the pkgtools/pkgdiff package. - * Look at the Makefile, fix if necessary; see Section 8.1, "Makefile". + * Look at the Makefile, fix if necessary; see Section 7.1, "Makefile". * Generate a PLIST: @@ -4722,7 +4852,7 @@ Create the directory where the package lives, plus any auxiliary directories: # cd bison # mkdir patches -Create Makefile, DESCR and PLIST (see Chapter 8, Package components - files, +Create Makefile, DESCR and PLIST (see Chapter 7, Package components - files, directories and contents) then continue with fetching the distfile: # make fetch |