diff options
author | wiz <wiz@pkgsrc.org> | 2004-11-22 16:52:08 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2004-11-22 16:52:08 +0000 |
commit | 5fde31ef6b942b309a13127fbbab9ec42595dd43 (patch) | |
tree | b93480535656ec8f95c6235c032e37ad77b976b2 | |
parent | 945f99b88da348639f3590bf0afdc324e744a107 (diff) | |
download | pkgsrc-5fde31ef6b942b309a13127fbbab9ec42595dd43.tar.gz |
Regen for USE_GMAKE removal; quite a lot of unrelated changes,
probably because I have newer versions of the software installed,
and of course because the section ids are automatic.
-rw-r--r-- | doc/pkgsrc.html | 6088 | ||||
-rw-r--r-- | doc/pkgsrc.txt | 1372 |
2 files changed, 3820 insertions, 3640 deletions
diff --git a/doc/pkgsrc.html b/doc/pkgsrc.html index 786ea30fb50..5474d74f87f 100644 --- a/doc/pkgsrc.html +++ b/doc/pkgsrc.html @@ -1,14 +1,14 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content= - "HTML Tidy for NetBSD (vers 1st October 2003), see www.w3.org" /> + "HTML Tidy for NetBSD (vers 1st August 2004), see www.w3.org" /> <meta http-equiv="Content-Type" content= "text/html; charset=us-ascii" /> <title>The pkgsrc guide</title> <link rel="stylesheet" href="/NetBSD.css" type="text/css" /> <meta name="generator" content= - "DocBook XSL Stylesheets V1.65.0" /> + "DocBook XSL Stylesheets V1.67.0" /> <meta name="description" content= "Information about using the NetBSD package system (pkgsrc) from both a user view for installing packages as well as from a pkgsrc developers' view for creating new packages." /> </head> @@ -19,8 +19,8 @@ alink="#0000FF"> <div class="titlepage"> <div> <div> - <h1 class="title"><a name="id2526935" id= - "id2526935"></a>The pkgsrc guide</h1> + <h1 class="title"><a name="id2458394" id= + "id2458394"></a>The pkgsrc guide</h1> </div> <div> @@ -37,8 +37,8 @@ alink="#0000FF"> <div class="affiliation"> <div class="address"> - <p><tt class="email"><<a href= - "mailto:agc@NetBSD.org">agc@NetBSD.org</a>></tt></p> + <p><code class="email"><<a href= + "mailto:agc@NetBSD.org">agc@NetBSD.org</a>></code></p> </div> </div> </div> @@ -50,8 +50,8 @@ alink="#0000FF"> <div class="affiliation"> <div class="address"> - <p><tt class="email"><<a href= - "mailto:hubertf@NetBSD.org">hubertf@NetBSD.org</a>></tt></p> + <p><code class="email"><<a href= + "mailto:hubertf@NetBSD.org">hubertf@NetBSD.org</a>></code></p> </div> </div> </div> @@ -93,7 +93,7 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2494406">1.1. + <dt><span class="sect1"><a href="#id2514275">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="#id2495052">2.1. + <dt><span class="sect1"><a href="#id2514853">2.1. As tar file</a></span></dt> - <dt><span class="sect1"><a href="#id2495069">2.2. + <dt><span class="sect1"><a href="#id2514870">2.2. Via SUP</a></span></dt> - <dt><span class="sect1"><a href="#id2495101">2.3. + <dt><span class="sect1"><a href="#id2514970">2.3. Via CVS</a></span></dt> </dl> </dd> @@ -133,32 +133,32 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2495211">3.1. + <dt><span class="sect1"><a href="#id2515148">3.1. Bootstrapping pkgsrc</a></span></dt> - <dt><span class="sect1"><a href="#id2495318">3.2. + <dt><span class="sect1"><a href="#id2515255">3.2. Platform specific notes</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2495324">3.2.1. Darwin (Mac OS + "#id2515261">3.2.1. Darwin (Mac OS X)</a></span></dt> <dt><span class="sect2"><a href= - "#id2495623">3.2.2. FreeBSD</a></span></dt> + "#id2515492">3.2.2. FreeBSD</a></span></dt> <dt><span class="sect2"><a href= - "#id2496272">3.2.3. Interix</a></span></dt> + "#id2515662">3.2.3. Interix</a></span></dt> <dt><span class="sect2"><a href= - "#id2496362">3.2.4. IRIX</a></span></dt> + "#id2515753">3.2.4. IRIX</a></span></dt> <dt><span class="sect2"><a href= - "#id2496480">3.2.5. OpenBSD</a></span></dt> + "#id2516280">3.2.5. OpenBSD</a></span></dt> <dt><span class="sect2"><a href= - "#id2496660">3.2.6. Solaris</a></span></dt> + "#id2516392">3.2.6. Solaris</a></span></dt> </dl> </dd> </dl> @@ -176,38 +176,38 @@ alink="#0000FF"> <dd> <dl> <dt><span class="sect2"><a href= - "#id2496865">4.1.1. Where to get binary + "#id2516529">4.1.1. Where to get binary packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2496905">4.1.2. How to use binary + "#id2516569">4.1.2. How to use binary packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2497040">4.1.3. A word of + "#id2516704">4.1.3. A word of warning</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2497051">4.2. + <dt><span class="sect1"><a href="#id2516715">4.2. Building packages from source</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2497129">4.2.1. + "#id2516725">4.2.1. Requirements</a></span></dt> <dt><span class="sect2"><a href= - "#id2497149">4.2.2. Fetching + "#id2516745">4.2.2. Fetching distfiles</a></span></dt> <dt><span class="sect2"><a href= - "#id2497202">4.2.3. How to build and + "#id2516866">4.2.3. How to build and install</a></span></dt> <dt><span class="sect2"><a href= - "#id2498133">4.2.4. Selecting the + "#id2517182">4.2.4. Selecting the compiler</a></span></dt> </dl> </dd> @@ -219,10 +219,10 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2563004">5.1. + <dt><span class="sect1"><a href="#id2517337">5.1. Building a single binary package</a></span></dt> - <dt><span class="sect1"><a href="#id2563082">5.2. + <dt><span class="sect1"><a href="#id2517825">5.2. Settings for creation of binary packages</a></span></dt> @@ -236,38 +236,38 @@ alink="#0000FF"> Configuration</a></span></dt> <dt><span class="sect2"><a href= - "#id2563222">5.3.2. Other environmental + "#id2517964">5.3.2. Other environmental considerations</a></span></dt> <dt><span class="sect2"><a href= - "#id2563262">5.3.3. Operation</a></span></dt> + "#id2518005">5.3.3. Operation</a></span></dt> <dt><span class="sect2"><a href= - "#id2563469">5.3.4. What it + "#id2583270">5.3.4. What it does</a></span></dt> <dt><span class="sect2"><a href= - "#id2563526">5.3.5. Disk space + "#id2583326">5.3.5. Disk space requirements</a></span></dt> <dt><span class="sect2"><a href= - "#id2563553">5.3.6. Setting up a sandbox for + "#id2583421">5.3.6. Setting up a sandbox for chroot'ed builds</a></span></dt> <dt><span class="sect2"><a href= - "#id2563916">5.3.7. Building a partial set of + "#id2583785">5.3.7. Building a partial set of packages</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2564027">5.4. + <dt><span class="sect1"><a href="#id2583828">5.4. Creating a multiple CD-ROM packages collection</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2564042">5.4.1. Example of + "#id2583843">5.4.1. Example of cdpack</a></span></dt> </dl> </dd> @@ -279,48 +279,50 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2564301">6.1. + <dt><span class="sect1"><a href="#id2584170">6.1. Is there a mailing list for pkg-related discussion?</a></span></dt> - <dt><span class="sect1"><a href="#id2564331">6.2. + <dt><span class="sect1"><a href="#id2584200">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="#id2564584">6.4. + <dt><span class="sect1"><a href="#id2584453">6.4. How to use pkgsrc as non-root</a></span></dt> - <dt><span class="sect1"><a href="#id2564596">6.5. + <dt><span class="sect1"><a href="#id2584465">6.5. How can I install/use XFree86 from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2564624">6.6. + <dt><span class="sect1"><a href="#id2584492">6.6. How can I install/use X.org from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2564651">6.7. + <dt><span class="sect1"><a href="#id2584520">6.7. How to fetch files from behind a firewall</a></span></dt> - <dt><span class="sect1"><a href="#id2564665">6.8. - How do I tell make fetch to do passive + <dt><span class="sect1"><a href="#id2584534">6.8. + 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="#id2564785">6.9. + <dt><span class="sect1"><a href="#id2584722">6.9. How to fetch all distfiles at once</a></span></dt> - <dt><span class="sect1"><a href="#id2564993">6.10. - What does Don't know how to make - /usr/share/tmac/tmac.andoc mean?</a></span></dt> - - <dt><span class="sect1"><a href="#id2565031">6.11. - What does Could not find bsd.own.mk + <dt><span class="sect1"><a href="#id2584861">6.10. + 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="#id2565089">6.12. + <dt><span class="sect1"><a href="#id2584900">6.11. + What does “<span class="quote">Could not find + bsd.own.mk</span>” mean?</a></span></dt> + + <dt><span class="sect1"><a href="#id2584957">6.12. Using 'sudo' with pkgsrc</a></span></dt> <dt><span class="sect1"><a href="#faq.conf">6.13. @@ -347,29 +349,30 @@ alink="#0000FF"> <dd> <dl> <dt><span class="sect1"><a href= - "#components.Makefile">7.1. - Makefile</a></span></dt> + "#components.Makefile">7.1. <code class= + "filename">Makefile</code></a></span></dt> <dt><span class="sect1"><a href= - "#components.distinfo">7.2. - distinfo</a></span></dt> + "#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="#id2566134">7.4. + <dt><span class="sect1"><a href="#id2586071">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="#id2566396">7.6. - work*</a></span></dt> + <dt><span class="sect1"><a href="#id2586197">7.6. + <code class="filename">work*</code></a></span></dt> - <dt><span class="sect1"><a href="#id2566484">7.7. - files/*</a></span></dt> + <dt><span class="sect1"><a href="#id2586284">7.7. + <code class= + "filename">files/*</code></a></span></dt> </dl> </dd> @@ -378,26 +381,29 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2566538">8.1. + <dt><span class="sect1"><a href="#id2586339">8.1. RCS ID</a></span></dt> - <dt><span class="sect1"><a href="#id2566621">8.2. - Semi-automatic PLIST generation</a></span></dt> + <dt><span class="sect1"><a href="#id2586354">8.2. + Semi-automatic <code class="filename">PLIST</code> + generation</a></span></dt> <dt><span class="sect1"><a href="#print-PLIST">8.3. - Tweaking output of make print-PLIST</a></span></dt> + Tweaking output of <span><strong class= + "command">make + print-PLIST</strong></span></a></span></dt> <dt><span class="sect1"><a href="#plist.misc">8.4. Variable substitution in PLIST</a></span></dt> - <dt><span class="sect1"><a href="#id2566874">8.5. + <dt><span class="sect1"><a href="#id2586743">8.5. Manpage-compression</a></span></dt> - <dt><span class="sect1"><a href="#id2566916">8.6. - Changing PLIST source with - PLIST_SRC</a></span></dt> + <dt><span class="sect1"><a href="#id2586785">8.6. + Changing PLIST source with <code class= + "varname">PLIST_SRC</code></a></span></dt> - <dt><span class="sect1"><a href="#id2566933">8.7. + <dt><span class="sect1"><a href="#id2586802">8.7. Platform specific and differing PLISTs</a></span></dt> @@ -412,37 +418,42 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2567137">9.1. + <dt><span class="sect1"><a href="#id2587074">9.1. Converting packages to use buildlink3</a></span></dt> - <dt><span class="sect1"><a href="#id2567532">9.2. - Writing buildlink3.mk files</a></span></dt> + <dt><span class="sect1"><a href="#id2587265">9.2. + Writing <code class="filename">buildlink3.mk</code> + files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2567670">9.2.1. Anatomy of a buildlink3.mk + "#id2587470">9.2.1. Anatomy of a buildlink3.mk file</a></span></dt> <dt><span class="sect2"><a href= - "#id2568110">9.2.2. Updating - BUILDLINK_DEPENDS.pkg in buildlink3.mk + "#id2588048">9.2.2. Updating <code class= + "varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code> in + <code class="filename">buildlink3.mk</code> files</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2568189">9.3. - Writing builtin.mk files</a></span></dt> + <dt><span class="sect1"><a href="#id2588126">9.3. + Writing <code class="filename">builtin.mk</code> + files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2568270">9.3.1. Anatomy of a builtin.mk + "#id2588208">9.3.1. Anatomy of a <code class= + "filename">builtin.mk</code> file</a></span></dt> <dt><span class="sect2"><a href= - "#id2568566">9.3.2. Global preferences for + "#id2588366">9.3.2. Global preferences for native or pkgsrc software</a></span></dt> </dl> </dd> @@ -454,12 +465,12 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2568638">10.1. + <dt><span class="sect1"><a href="#id2588507">10.1. Global default options</a></span></dt> - <dt><span class="sect1"><a href="#id2568653">10.2. - Converting packages to use - bsd.options.mk</a></span></dt> + <dt><span class="sect1"><a href="#id2588522">10.2. + Converting packages to use <code class= + "filename">bsd.options.mk</code></a></span></dt> </dl> </dd> @@ -472,7 +483,7 @@ alink="#0000FF"> "#build.prefix">11.1. Program location</a></span></dt> - <dt><span class="sect1"><a href="#id2569330">11.2. + <dt><span class="sect1"><a href="#id2589198">11.2. Main targets</a></span></dt> <dt><span class="sect1"><a href= @@ -486,17 +497,17 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2570795">12.1. + <dt><span class="sect1"><a href="#id2590531">12.1. General operation</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2570798">12.1.1. How to pull in variables + "#id2590534">12.1.1. How to pull in variables from /etc/mk.conf</a></span></dt> <dt><span class="sect2"><a href= - "#id2570882">12.1.2. Restricted + "#id2590685">12.1.2. Restricted packages</a></span></dt> <dt><span class="sect2"><a href= @@ -504,15 +515,15 @@ alink="#0000FF"> dependencies</a></span></dt> <dt><span class="sect2"><a href= - "#id2571260">12.1.4. Handling conflicts with + "#id2591201">12.1.4. Handling conflicts with other packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2571447">12.1.5. Packages that cannot or + "#id2591251">12.1.5. Packages that cannot or should not be built</a></span></dt> <dt><span class="sect2"><a href= - "#id2571473">12.1.6. Packages which should not + "#id2591413">12.1.6. Packages which should not be deleted, once installed</a></span></dt> <dt><span class="sect2"><a href= @@ -520,37 +531,37 @@ alink="#0000FF"> with security problems</a></span></dt> <dt><span class="sect2"><a href= - "#id2571564">12.1.8. How to handle compiler + "#id2591505">12.1.8. How to handle compiler bugs</a></span></dt> <dt><span class="sect2"><a href= - "#id2571587">12.1.9. How to handle incrementing + "#id2591527">12.1.9. How to handle incrementing versions when fixing an existing package</a></span></dt> <dt><span class="sect2"><a href= - "#id2571704">12.1.10. Portability of + "#id2591644">12.1.10. Portability of packages</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2571729">12.2. + <dt><span class="sect1"><a href="#id2591669">12.2. Possible downloading issues</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2571732">12.2.1. Packages whose distfiles + "#id2591672">12.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt> <dt><span class="sect2"><a href= - "#id2571795">12.2.2. How to handle modified + "#id2591735">12.2.2. How to handle modified distfiles with the 'old' name</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2571806">12.3. + <dt><span class="sect1"><a href="#id2591747">12.3. Configuration gotchas</a></span></dt> <dd> @@ -560,66 +571,66 @@ alink="#0000FF"> libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2572350">12.3.2. Using libtool on GNU + "#id2592086">12.3.2. Using libtool on GNU packages that already support libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2572435">12.3.3. GNU + "#id2592238">12.3.3. GNU Autoconf/Automake</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2572480">12.4. + <dt><span class="sect1"><a href="#id2592283">12.4. Building considerations</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2572483">12.4.1. CPP + "#id2592286">12.4.1. CPP defines</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2572513">12.5. + <dt><span class="sect1"><a href="#id2592316">12.5. Package specific actions</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2572516">12.5.1. Package configuration + "#id2592320">12.5.1. Package configuration files</a></span></dt> <dt><span class="sect2"><a href= - "#id2572618">12.5.2. User + "#id2592490">12.5.2. User interaction</a></span></dt> <dt><span class="sect2"><a href= - "#id2572663">12.5.3. Handling + "#id2592535">12.5.3. Handling licenses</a></span></dt> <dt><span class="sect2"><a href= - "#id2572746">12.5.4. Creating an account from a + "#id2592686">12.5.4. Creating an account from a package</a></span></dt> <dt><span class="sect2"><a href= - "#id2572876">12.5.5. Installing score + "#id2592748">12.5.5. Installing score files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573057">12.5.6. Packages providing login + "#id2592929">12.5.6. Packages providing login shells</a></span></dt> <dt><span class="sect2"><a href= - "#id2573182">12.5.7. Packages containing perl + "#id2593054">12.5.7. Packages containing perl scripts</a></span></dt> <dt><span class="sect2"><a href= - "#id2573201">12.5.8. Packages with hardcoded + "#id2593073">12.5.8. Packages with hardcoded paths to other interpreters</a></span></dt> <dt><span class="sect2"><a href= - "#id2573222">12.5.9. Packages installing perl + "#id2593094">12.5.9. Packages installing perl modules</a></span></dt> <dt><span class="sect2"><a href= @@ -627,36 +638,36 @@ alink="#0000FF"> info files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573442">12.5.11. Packages installing + "#id2593450">12.5.11. Packages installing GConf2 data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573610">12.5.12. Packages installing + "#id2593550">12.5.12. Packages installing scrollkeeper data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573661">12.5.13. Packages installing X11 + "#id2593602">12.5.13. Packages installing X11 fonts</a></span></dt> <dt><span class="sect2"><a href= - "#id2573708">12.5.14. Packages installing GTK2 + "#id2593649">12.5.14. Packages installing GTK2 modules</a></span></dt> <dt><span class="sect2"><a href= - "#id2573778">12.5.15. Packages installing SGML + "#id2593718">12.5.15. Packages installing SGML or XML data</a></span></dt> <dt><span class="sect2"><a href= - "#id2573830">12.5.16. Packages installing + "#id2593770">12.5.16. Packages installing extensions to the MIME database</a></span></dt> <dt><span class="sect2"><a href= - "#id2573969">12.5.17. Packages using + "#id2593841">12.5.17. Packages using intltool</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2573982">12.6. + <dt><span class="sect1"><a href="#id2593854">12.6. Feedback to the author</a></span></dt> </dl> </dd> @@ -669,18 +680,18 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2574444">14.1. + <dt><span class="sect1"><a href="#id2594385">14.1. Submitting your packages</a></span></dt> - <dt><span class="sect1"><a href="#id2574491">14.2. + <dt><span class="sect1"><a href="#id2594432">14.2. Committing: Importing a package into CVS</a></span></dt> - <dt><span class="sect1"><a href="#id2574691">14.3. + <dt><span class="sect1"><a href="#id2594563">14.3. Updating a package to a newer version</a></span></dt> - <dt><span class="sect1"><a href="#id2574710">14.4. + <dt><span class="sect1"><a href="#id2594582">14.4. Moving a package in pkgsrc</a></span></dt> </dl> </dd> @@ -692,26 +703,27 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2575004">A.1. + <dt><span class="sect1"><a href="#id2594808">A.1. files</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2575008">A.1.1. + <dt><span class="sect2"><a href="#id2594811">A.1.1. Makefile</a></span></dt> - <dt><span class="sect2"><a href="#id2575015">A.1.2. + <dt><span class="sect2"><a href="#id2594887">A.1.2. DESCR</a></span></dt> - <dt><span class="sect2"><a href="#id2575030">A.1.3. + <dt><span class="sect2"><a href="#id2594902">A.1.3. PLIST</a></span></dt> - <dt><span class="sect2"><a href="#id2575037">A.1.4. - Checking a package with pkglint</a></span></dt> + <dt><span class="sect2"><a href="#id2594909">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="#id2575078">A.2. Steps + <dt><span class="sect1"><a href="#id2594950">A.2. Steps for building, installing, packaging</a></span></dt> </dl> </dd> @@ -737,10 +749,10 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2575861">D.1. + <dt><span class="sect1"><a href="#id2595665">D.1. Targets</a></span></dt> - <dt><span class="sect1"><a href="#id2576068">D.2. + <dt><span class="sect1"><a href="#id2595940">D.2. Procedure</a></span></dt> </dl> </dd> @@ -761,7 +773,7 @@ alink="#0000FF"> <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2494406">1.1. + <dt><span class="sect1"><a href="#id2514275">1.1. Introduction</a></span></dt> <dt><span class="sect1"><a href="#overview">1.2. @@ -780,8 +792,8 @@ alink="#0000FF"> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2494406" id= - "id2494406"></a>1.1. Introduction</h2> + "id2514275" id= + "id2514275"></a>1.1. Introduction</h2> </div> </div> </div> @@ -796,10 +808,11 @@ alink="#0000FF"> single command.</p> <p>Once the software has been built, it is manipulated with - the <span><b class="command">pkg_*</b></span> tools so that - installation and de-installation, printing of an inventory - of all installed packages and retrieval of one-line - comments or more verbose descriptions are all simple.</p> + the <span><strong class="command">pkg_*</strong></span> + tools so that installation and de-installation, printing of + an inventory of all installed packages and retrieval of + one-line comments or more verbose descriptions are all + simple.</p> <p>pkgsrc currently contains several thousand packages, including:</p> @@ -810,32 +823,32 @@ alink="#0000FF"> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/apache/README.html" - class="pkgname">www/apache</a> - The Apache web - server</p> + class="pkgname">www/apache</a> - The Apache web + server</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/mozilla/README.html" - class="pkgname">www/mozilla</a> - The Mozilla web - browser</p> + class="pkgname">www/mozilla</a> - The Mozilla web + browser</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/meta-pkgs/gnome/README.html" - class="pkgname">meta-pkgs/gnome</a> - The GNOME - Desktop Environment</p> + class="pkgname">meta-pkgs/gnome</a> - The GNOME + Desktop Environment</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/meta-pkgs/kde3/README.html" - class="pkgname">meta-pkgs/kde3</a> - The K Desktop - Environment</p> + class="pkgname">meta-pkgs/kde3</a> - The K Desktop + Environment</p> </li> </ul> </div> @@ -974,8 +987,8 @@ alink="#0000FF"> <p>A set of files and building instructions that describe what's necessary to build a certain piece of software using pkgsrc. Packages are traditionally - stored under <tt class= - "filename">/usr/pkgsrc</tt>.</p> + stored under <code class= + "filename">/usr/pkgsrc</code>.</p> </dd> <dt><span class="term">The NetBSD package @@ -999,8 +1012,8 @@ alink="#0000FF"> build on NetBSD are reflected in the corresponding package. Usually the distfile is in the form of a compressed tar-archive, but other types are possible, - too. Distfiles are usually stored below <tt class= - "filename">/usr/pkgsrc/distfiles</tt>.</p> + too. Distfiles are usually stored below <code class= + "filename">/usr/pkgsrc/distfiles</code>.</p> </dd> <dt><span class="term">Port</span></dt> @@ -1018,12 +1031,13 @@ alink="#0000FF"> <dd> <p>A set of binaries built with pkgsrc from a - distfile and stuffed together in a single <tt class= - "filename">.tgz</tt> file so it can be installed on - machines of the same machine architecture without the - need to recompile. Packages are usually generated in - <tt class="filename">/usr/pkgsrc/packages</tt>; there - is also an archive on <a href= + distfile and stuffed together in a single + <code class="filename">.tgz</code> file so it can be + installed on machines of the same machine + architecture without the need to recompile. Packages + are usually generated in <code class= + "filename">/usr/pkgsrc/packages</code>; there is also + an archive on <a href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/" target= "_top">ftp.NetBSD.org</a>.</p> @@ -1058,10 +1072,10 @@ alink="#0000FF"> <p>When giving examples for commands, shell prompts are used to show if the command should/can be issued as root, or if “<span class="quote">normal</span>” user - privileges are sufficient. We use a <tt class= - "prompt">#</tt> for root's shell prompt, and a <tt class= - "prompt">$</tt> for users' shell prompt, assuming they use - the C-shell or tcsh.</p> + 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, + assuming they use the C-shell or tcsh.</p> </div> </div> @@ -1084,13 +1098,13 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2495052">2.1. As + <dt><span class="sect1"><a href="#id2514853">2.1. As tar file</a></span></dt> - <dt><span class="sect1"><a href="#id2495069">2.2. Via + <dt><span class="sect1"><a href="#id2514870">2.2. Via SUP</a></span></dt> - <dt><span class="sect1"><a href="#id2495101">2.3. Via + <dt><span class="sect1"><a href="#id2514970">2.3. Via CVS</a></span></dt> </dl> </dd> @@ -1100,32 +1114,32 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2495211">3.1. + <dt><span class="sect1"><a href="#id2515148">3.1. Bootstrapping pkgsrc</a></span></dt> - <dt><span class="sect1"><a href="#id2495318">3.2. + <dt><span class="sect1"><a href="#id2515255">3.2. Platform specific notes</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2495324">3.2.1. Darwin (Mac OS + "#id2515261">3.2.1. Darwin (Mac OS X)</a></span></dt> <dt><span class="sect2"><a href= - "#id2495623">3.2.2. FreeBSD</a></span></dt> + "#id2515492">3.2.2. FreeBSD</a></span></dt> <dt><span class="sect2"><a href= - "#id2496272">3.2.3. Interix</a></span></dt> + "#id2515662">3.2.3. Interix</a></span></dt> <dt><span class="sect2"><a href= - "#id2496362">3.2.4. IRIX</a></span></dt> + "#id2515753">3.2.4. IRIX</a></span></dt> <dt><span class="sect2"><a href= - "#id2496480">3.2.5. OpenBSD</a></span></dt> + "#id2516280">3.2.5. OpenBSD</a></span></dt> <dt><span class="sect2"><a href= - "#id2496660">3.2.6. Solaris</a></span></dt> + "#id2516392">3.2.6. Solaris</a></span></dt> </dl> </dd> </dl> @@ -1143,37 +1157,37 @@ alink="#0000FF"> <dd> <dl> <dt><span class="sect2"><a href= - "#id2496865">4.1.1. Where to get binary + "#id2516529">4.1.1. Where to get binary packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2496905">4.1.2. How to use binary + "#id2516569">4.1.2. How to use binary packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2497040">4.1.3. A word of + "#id2516704">4.1.3. A word of warning</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2497051">4.2. + <dt><span class="sect1"><a href="#id2516715">4.2. Building packages from source</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2497129">4.2.1. Requirements</a></span></dt> + "#id2516725">4.2.1. Requirements</a></span></dt> <dt><span class="sect2"><a href= - "#id2497149">4.2.2. Fetching + "#id2516745">4.2.2. Fetching distfiles</a></span></dt> <dt><span class="sect2"><a href= - "#id2497202">4.2.3. How to build and + "#id2516866">4.2.3. How to build and install</a></span></dt> <dt><span class="sect2"><a href= - "#id2498133">4.2.4. Selecting the + "#id2517182">4.2.4. Selecting the compiler</a></span></dt> </dl> </dd> @@ -1185,10 +1199,10 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2563004">5.1. + <dt><span class="sect1"><a href="#id2517337">5.1. Building a single binary package</a></span></dt> - <dt><span class="sect1"><a href="#id2563082">5.2. + <dt><span class="sect1"><a href="#id2517825">5.2. Settings for creation of binary packages</a></span></dt> @@ -1202,37 +1216,37 @@ alink="#0000FF"> Configuration</a></span></dt> <dt><span class="sect2"><a href= - "#id2563222">5.3.2. Other environmental + "#id2517964">5.3.2. Other environmental considerations</a></span></dt> <dt><span class="sect2"><a href= - "#id2563262">5.3.3. Operation</a></span></dt> + "#id2518005">5.3.3. Operation</a></span></dt> <dt><span class="sect2"><a href= - "#id2563469">5.3.4. What it does</a></span></dt> + "#id2583270">5.3.4. What it does</a></span></dt> <dt><span class="sect2"><a href= - "#id2563526">5.3.5. Disk space + "#id2583326">5.3.5. Disk space requirements</a></span></dt> <dt><span class="sect2"><a href= - "#id2563553">5.3.6. Setting up a sandbox for + "#id2583421">5.3.6. Setting up a sandbox for chroot'ed builds</a></span></dt> <dt><span class="sect2"><a href= - "#id2563916">5.3.7. Building a partial set of + "#id2583785">5.3.7. Building a partial set of packages</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2564027">5.4. + <dt><span class="sect1"><a href="#id2583828">5.4. Creating a multiple CD-ROM packages collection</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2564042">5.4.1. Example of + "#id2583843">5.4.1. Example of cdpack</a></span></dt> </dl> </dd> @@ -1244,46 +1258,48 @@ alink="#0000FF"> <dd> <dl> - <dt><span class="sect1"><a href="#id2564301">6.1. Is + <dt><span class="sect1"><a href="#id2584170">6.1. Is there a mailing list for pkg-related discussion?</a></span></dt> - <dt><span class="sect1"><a href="#id2564331">6.2. + <dt><span class="sect1"><a href="#id2584200">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="#id2564584">6.4. How + <dt><span class="sect1"><a href="#id2584453">6.4. How to use pkgsrc as non-root</a></span></dt> - <dt><span class="sect1"><a href="#id2564596">6.5. How + <dt><span class="sect1"><a href="#id2584465">6.5. How can I install/use XFree86 from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2564624">6.6. How + <dt><span class="sect1"><a href="#id2584492">6.6. How can I install/use X.org from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2564651">6.7. How + <dt><span class="sect1"><a href="#id2584520">6.7. How to fetch files from behind a firewall</a></span></dt> - <dt><span class="sect1"><a href="#id2564665">6.8. How - do I tell make fetch to do passive + <dt><span class="sect1"><a href="#id2584534">6.8. 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="#id2564785">6.9. How + <dt><span class="sect1"><a href="#id2584722">6.9. How to fetch all distfiles at once</a></span></dt> - <dt><span class="sect1"><a href="#id2564993">6.10. - What does Don't know how to make - /usr/share/tmac/tmac.andoc mean?</a></span></dt> - - <dt><span class="sect1"><a href="#id2565031">6.11. - What does Could not find bsd.own.mk + <dt><span class="sect1"><a href="#id2584861">6.10. + 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="#id2565089">6.12. + <dt><span class="sect1"><a href="#id2584900">6.11. + What does “<span class="quote">Could not find + bsd.own.mk</span>” mean?</a></span></dt> + + <dt><span class="sect1"><a href="#id2584957">6.12. Using 'sudo' with pkgsrc</a></span></dt> <dt><span class="sect1"><a href="#faq.conf">6.13. @@ -1313,13 +1329,13 @@ alink="#0000FF"> <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2495052">2.1. As + <dt><span class="sect1"><a href="#id2514853">2.1. As tar file</a></span></dt> - <dt><span class="sect1"><a href="#id2495069">2.2. Via + <dt><span class="sect1"><a href="#id2514870">2.2. Via SUP</a></span></dt> - <dt><span class="sect1"><a href="#id2495101">2.3. Via + <dt><span class="sect1"><a href="#id2514970">2.3. Via CVS</a></span></dt> </dl> </div> @@ -1333,7 +1349,7 @@ alink="#0000FF"> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2495052" id="id2495052"></a>2.1. As tar + "id2514853" id="id2514853"></a>2.1. As tar file</h2> </div> </div> @@ -1342,8 +1358,8 @@ alink="#0000FF"> <p>To get pkgsrc going, you need to get the pkgsrc.tar.gz file from <a href= "ftp://ftp.NetBSD.org/pub/NetBSD-current/tar_files/pkgsrc.tar.gz" - target="_top">ftp.NetBSD.org</a> and unpack it into - <tt class="filename">/usr/pkgsrc</tt>.</p> + target="_top">ftp.NetBSD.org</a> and unpack it into + <code class="filename">/usr/pkgsrc</code>.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -1351,7 +1367,7 @@ alink="#0000FF"> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2495069" id="id2495069"></a>2.2. Via + "id2514870" id="id2514870"></a>2.2. Via SUP</h2> </div> </div> @@ -1364,12 +1380,12 @@ alink="#0000FF"> release=pkgsrc </pre> - <p>in it, see the examples in <tt class= - "filename">/usr/share/examples/supfiles</tt>, and that - the <tt class="filename">/usr/pkgsrc</tt> directory - exists. Then, simply run <span><b class="command">sup -v - <i class= - "replaceable"><tt>/path/to/your/supfile</tt></i></b></span>.</p> + <p>in it, see the examples in <code class= + "filename">/usr/share/examples/supfiles</code>, and that + the <code class="filename">/usr/pkgsrc</code> directory + exists. Then, simply run <span><strong class= + "command">sup -v <em class= + "replaceable"><code>/path/to/your/supfile</code></em></strong></span>.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -1377,7 +1393,7 @@ release=pkgsrc <div> <div> <h2 class="title" style="clear: both"><a name= - "id2495101" id="id2495101"></a>2.3. Via + "id2514970" id="id2514970"></a>2.3. Via CVS</h2> </div> </div> @@ -1389,26 +1405,28 @@ release=pkgsrc precompiled binary on ftp.NetBSD.org. To do an initial (full) checkout of pkgsrc, do the following steps:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>setenv CVSROOT anoncvs@anoncvs.NetBSD.org:/cvsroot</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>setenv CVS_RSH ssh</tt></b> -<tt class="prompt">%</tt> <b class="userinput"><tt>cd /usr</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>cvs checkout -P pkgsrc</tt></b> -</pre> - - <p>This will create the <tt class="filename">pkgsrc</tt> - directory in your <tt class="filename">/usr</tt>, and all - the package source will be stored under <tt class= - "filename">/usr/pkgsrc</tt>. To update pkgsrc after the - initial checkout, make sure you have <tt class= - "varname">CVS_RSH</tt> set as above, then do:</p> +<code class="prompt">%</code> <strong class= +"userinput"><code>setenv CVSROOT anoncvs@anoncvs.NetBSD.org:/cvsroot</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>setenv CVS_RSH ssh</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>cd /usr</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>cvs checkout -P pkgsrc</code></strong> +</pre> + + <p>This will create the <code class= + "filename">pkgsrc</code> directory in your <code class= + "filename">/usr</code>, and all the package source will + be stored under <code class= + "filename">/usr/pkgsrc</code>. To update pkgsrc after the + initial checkout, make sure you have <code class= + "varname">CVS_RSH</code> set as above, then do:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>cd /usr/pkgsrc</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>cvs -q update -dP</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>cd /usr/pkgsrc</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>cvs -q update -dP</code></strong> </pre> <p>Please also note that it is possible to have multiple @@ -1432,30 +1450,30 @@ release=pkgsrc <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2495211">3.1. + <dt><span class="sect1"><a href="#id2515148">3.1. Bootstrapping pkgsrc</a></span></dt> - <dt><span class="sect1"><a href="#id2495318">3.2. + <dt><span class="sect1"><a href="#id2515255">3.2. Platform specific notes</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2495324">3.2.1. + <dt><span class="sect2"><a href="#id2515261">3.2.1. Darwin (Mac OS X)</a></span></dt> - <dt><span class="sect2"><a href="#id2495623">3.2.2. + <dt><span class="sect2"><a href="#id2515492">3.2.2. FreeBSD</a></span></dt> - <dt><span class="sect2"><a href="#id2496272">3.2.3. + <dt><span class="sect2"><a href="#id2515662">3.2.3. Interix</a></span></dt> - <dt><span class="sect2"><a href="#id2496362">3.2.4. + <dt><span class="sect2"><a href="#id2515753">3.2.4. IRIX</a></span></dt> - <dt><span class="sect2"><a href="#id2496480">3.2.5. + <dt><span class="sect2"><a href="#id2516280">3.2.5. OpenBSD</a></span></dt> - <dt><span class="sect2"><a href="#id2496660">3.2.6. + <dt><span class="sect2"><a href="#id2516392">3.2.6. Solaris</a></span></dt> </dl> </dd> @@ -1467,8 +1485,8 @@ release=pkgsrc <div> <div> <h2 class="title" style="clear: both"><a name= - "id2495211" id= - "id2495211"></a>3.1. Bootstrapping pkgsrc</h2> + "id2515148" id= + "id2515148"></a>3.1. Bootstrapping pkgsrc</h2> </div> </div> </div> @@ -1516,23 +1534,24 @@ release=pkgsrc <p>Installing the bootstrap kit should be as simple as:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>env CVS_RSH=ssh cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout pkgsrc</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd pkgsrc/bootstrap</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>./bootstrap</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>env CVS_RSH=ssh cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout pkgsrc</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd pkgsrc/bootstrap</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>./bootstrap</code></strong> </pre> <p>See <a href="#getting" title= "Chapter 2. Where to get pkgsrc">Chapter 2, <i>Where to get pkgsrc</i></a> for other ways to get - pkgsrc before bootstrapping. The given <span><b class= - "command">bootstrap</b></span> command will use the - defaults of <tt class="filename">/usr/pkg</tt> for the - <span class="emphasis"><em>prefix</em></span> where - programs will be installed in, and <tt class= - "filename">/var/db/pkg</tt> for the package database + pkgsrc before bootstrapping. The given + <span><strong class="command">bootstrap</strong></span> + command will use the defaults of <code class= + "filename">/usr/pkg</code> for the <span class= + "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. However, these can also be set using command-line parameters.</p> @@ -1549,7 +1568,7 @@ release=pkgsrc <div> <div> <h2 class="title" style="clear: both"><a name= - "id2495318" id="id2495318"></a>3.2. Platform + "id2515255" id="id2515255"></a>3.2. Platform specific notes</h2> </div> </div> @@ -1562,8 +1581,8 @@ release=pkgsrc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2495324" id= - "id2495324"></a>3.2.1. Darwin (Mac OS + <h3 class="title"><a name="id2515261" id= + "id2515261"></a>3.2.1. Darwin (Mac OS X)</h3> </div> </div> @@ -1617,14 +1636,14 @@ release=pkgsrc <p>Create the disk image:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd pkgsrc/bootstrap</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>./ufsdiskimage create ~/Documents/NetBSD 512</tt></b> # megabytes - season to taste -<tt class="prompt">#</tt> <b class= -"userinput"><tt>./ufsdiskimage mount ~/Documents/NetBSD</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>sudo chown `id -u`:`id -g` /Volumes/NetBSD</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd pkgsrc/bootstrap</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>./ufsdiskimage create ~/Documents/NetBSD 512</code></strong> # megabytes - season to taste +<code class="prompt">#</code> <strong class= +"userinput"><code>./ufsdiskimage mount ~/Documents/NetBSD</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>sudo chown `id -u`:`id -g` /Volumes/NetBSD</code></strong> </pre> <p>That's it!</p> @@ -1641,26 +1660,26 @@ release=pkgsrc </div> </div> - <p>By default, <tt class="filename">/usr</tt> will be - on your root file system, normally HFS+. It is - possible to use the default <span class= - "emphasis"><em>prefix</em></span> of <tt class= - "filename">/usr/pkg</tt> by symlinking <tt class= - "filename">/usr/pkg</tt> to a directory on a UFS file - system. Obviously, another symlink is required if you - want to place the package database directory outside - the <span class="emphasis"><em>prefix</em></span>. - e.g.</p> + <p>By default, <code class="filename">/usr</code> + will be on your root file system, normally HFS+. It + is possible to use the default <span class= + "emphasis"><em>prefix</em></span> of <code class= + "filename">/usr/pkg</code> by symlinking <code class= + "filename">/usr/pkg</code> to a directory on a UFS + file system. Obviously, another symlink is required + if you want to place the package database directory + outside the <span class= + "emphasis"><em>prefix</em></span>. e.g.</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>./bootstrap --pkgdbdir=/usr/pkg/pkgdb --pkgsrcdir=/Volumes/ufs/pkgsrc</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>./bootstrap --pkgdbdir=/usr/pkg/pkgdb --pkgsrcdir=/Volumes/ufs/pkgsrc</code></strong> </pre> <p>If you created your partitions at the time of installing Mac OS X and formatted the target partition as UFS, it should automatically mount on - <tt class="filename">/Volumes/<volume - name></tt> when the machine boots. If you are + <code class="filename">/Volumes/<volume + name></code> when the machine boots. If you are (re)formatting a partition as UFS, you need to ensure that the partition map correctly reflects “<span class="quote">Apple_UFS</span>” @@ -1695,8 +1714,8 @@ release=pkgsrc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2495623" id= - "id2495623"></a>3.2.2. FreeBSD</h3> + <h3 class="title"><a name="id2515492" id= + "id2515492"></a>3.2.2. FreeBSD</h3> </div> </div> </div> @@ -1712,10 +1731,10 @@ release=pkgsrc <ol type="1"> <li> <p>FreeBSD stores its ports pkg database in - <tt class="filename">/var/db/pkg</tt>. It is + <code class="filename">/var/db/pkg</code>. It is therefore recommended that you choose a different - location (e.g. <tt class= - "filename">/usr/pkgdb</tt>) by using the + location (e.g. <code class= + "filename">/usr/pkgdb</code>) by using the --pkgdbdir option to the bootstrap script.</p> </li> @@ -1724,24 +1743,25 @@ release=pkgsrc tools, it's probably a good idea to move them out of the way to avoid confusion, e.g.</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd /usr/sbin</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mv pkg_add pkg_add.orig</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mv pkg_create pkg_create.orig</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mv pkg_delete pkg_delete.orig</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mv pkg_info pkg_info.orig</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd /usr/sbin</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mv pkg_add pkg_add.orig</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mv pkg_create pkg_create.orig</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mv pkg_delete pkg_delete.orig</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mv pkg_info pkg_info.orig</code></strong> </pre> </li> <li> - <p>An example <tt class= - "filename">/etc/mk.conf</tt> file will be placed - in <tt class="filename">/etc/mk.conf.example</tt> - file when you use the bootstrap script.</p> + <p>An example <code class= + "filename">/etc/mk.conf</code> file will be + placed in <code class= + "filename">/etc/mk.conf.example</code> file when + you use the bootstrap script.</p> </li> </ol> </div> @@ -1751,8 +1771,8 @@ release=pkgsrc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2496272" id= - "id2496272"></a>3.2.3. Interix</h3> + <h3 class="title"><a name="id2515662" id= + "id2515662"></a>3.2.3. Interix</h3> </div> </div> </div> @@ -1922,17 +1942,17 @@ release=pkgsrc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2496362" id= - "id2496362"></a>3.2.4. IRIX</h3> + <h3 class="title"><a name="id2515753" id= + "id2515753"></a>3.2.4. IRIX</h3> </div> </div> </div> <p>You will need a working C compiler, either gcc or SGI's MIPS and MIPSpro compiler (cc/c89). Please set - the <tt class="varname">CC</tt> environment variable - according to your preference. If you do not have a - license for the MIPSpro compiler suite, you can + the <code class="varname">CC</code> environment + variable according to your preference. If you do not + have a license for the MIPSpro compiler suite, you can download a gcc tardist file from <a href= "http://freeware.sgi.com/" target= "_top">http://freeware.sgi.com/</a>.</p> @@ -1949,16 +1969,16 @@ release=pkgsrc built with.</p> <p>Therefore, please make sure that you have no - conflicting <tt class="varname">CFLAGS</tt> in your - environment or the <tt class= - "filename">/etc/mk.conf</tt>. Particularly, make sure + conflicting <code class="varname">CFLAGS</code> in your + environment or the <code class= + "filename">/etc/mk.conf</code>. Particularly, make sure that you do not try to link n32 object files with lib64 - or vice versa. Check your <tt class= - "filename">/etc/compiler.defaults</tt>!</p> + or vice versa. Check your <code class= + "filename">/etc/compiler.defaults</code>!</p> <p>If you have the actual pkgsrc tree mounted via NFS from a different host, please make sure to set - <tt class="varname">WRKOBJDIR</tt> to a local + <code class="varname">WRKOBJDIR</code> to a local directory, as it appears that IRIX linker occasionally runs into issues when trying to link over a network mounted filesystem.</p> @@ -1966,8 +1986,8 @@ release=pkgsrc <p>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 <tt class= - "filename">pkgsrc/mk/bsd.pkg.defaults.mk</tt> and, of + Please see <code class= + "filename">pkgsrc/mk/bsd.pkg.defaults.mk</code> and, of course, your compilers man pages for details.</p> </div> @@ -1975,8 +1995,8 @@ release=pkgsrc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2496480" id= - "id2496480"></a>3.2.5. OpenBSD</h3> + <h3 class="title"><a name="id2516280" id= + "id2516280"></a>3.2.5. OpenBSD</h3> </div> </div> </div> @@ -1991,10 +2011,10 @@ release=pkgsrc <ol type="1"> <li> <p>OpenBSD stores its ports pkg database in - <tt class="filename">/var/db/pkg</tt>. It is + <code class="filename">/var/db/pkg</code>. It is therefore recommended that you choose a different - location (e.g. <tt class= - "filename">/usr/pkgdb</tt>) by using the + location (e.g. <code class= + "filename">/usr/pkgdb</code>) by using the --pkgdbdir option to the bootstrap script.</p> </li> @@ -2003,26 +2023,27 @@ release=pkgsrc tools, it's probably a good idea to move them out of the way to avoid confusion, e.g.</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd /usr/sbin</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mv pkg_add pkg_add.orig</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mv pkg_create pkg_create.orig</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mv pkg_delete pkg_delete.orig</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mv pkg_info pkg_info.orig</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd /usr/sbin</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mv pkg_add pkg_add.orig</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mv pkg_create pkg_create.orig</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mv pkg_delete pkg_delete.orig</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mv pkg_info pkg_info.orig</code></strong> </pre> </li> <li> - <p>An example <tt class= - "filename">/etc/mk.conf</tt> file will be placed - in <tt class="filename">/etc/mk.conf.example</tt> - file when you use the bootstrap script. OpenBSD's - make program uses <tt class= - "filename">/etc/mk.conf</tt> as well. You can + <p>An example <code class= + "filename">/etc/mk.conf</code> file will be + placed in <code class= + "filename">/etc/mk.conf.example</code> file when + you use the bootstrap script. OpenBSD's make + program uses <code class= + "filename">/etc/mk.conf</code> as well. You can work around this by enclosing all the pkgsrc specific parts of the file with:</p> <pre class="programlisting"> @@ -2041,8 +2062,8 @@ release=pkgsrc <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2496660" id= - "id2496660"></a>3.2.6. Solaris</h3> + <h3 class="title"><a name="id2516392" id= + "id2516392"></a>3.2.6. Solaris</h3> </div> </div> </div> @@ -2086,8 +2107,8 @@ release=pkgsrc <div class="titlepage"> <div> <div> - <h4 class="title"><a name="id2496691" id= - "id2496691"></a>3.2.6.1. If you are using + <h4 class="title"><a name="id2516423" id= + "id2516423"></a>3.2.6.1. If you are using gcc</h4> </div> </div> @@ -2101,23 +2122,23 @@ release=pkgsrc <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/lang/gcc/README.html" - class="pkgname">lang/gcc</a> or install a binary - gcc package, then remove gcc used during - bootstrapping.</p> + class="pkgname">lang/gcc</a> or install a binary gcc + package, then remove gcc used during + bootstrapping.</p> <p>Binary packages of gcc can be found through <a href= "http://www.sun.com/bigadmin/common/freewareSearch.html" - target= - "_top">http://www.sun.com/bigadmin/common/freewareSearch.html</a>.</p> + target= + "_top">http://www.sun.com/bigadmin/common/freewareSearch.html</a>.</p> </div> <div class="sect3" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h4 class="title"><a name="id2496712" id= - "id2496712"></a>3.2.6.2. If you are using + <h4 class="title"><a name="id2516444" id= + "id2516444"></a>3.2.6.2. If you are using Sun WorkShop</h4> </div> </div> @@ -2148,10 +2169,10 @@ release=pkgsrc </ul> </div> - <p>You should set <tt class="varname">CC</tt>, - <tt class="varname">CXX</tt> and optionally, - <tt class="varname">CPP</tt> in <tt class= - "filename">/etc/mk.conf</tt>, eg.</p> + <p>You should set <code class="varname">CC</code>, + <code class="varname">CXX</code> and optionally, + <code class="varname">CPP</code> in <code class= + "filename">/etc/mk.conf</code>, eg.</p> <pre class="programlisting"> CC= cc CXX= CC @@ -2166,9 +2187,10 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>Whichever compiler you use, please ensure the compiler tools and your $prefix are in your - <tt class="varname">PATH</tt>. This includes - <tt class="filename">/usr/ccs/{bin,lib}</tt> and eg. - <tt class="filename">/usr/pkg/{bin,sbin}</tt>.</p> + <code class="varname">PATH</code>. This includes + <code class="filename">/usr/ccs/{bin,lib}</code> and + eg. <code class= + "filename">/usr/pkg/{bin,sbin}</code>.</p> </div> </div> </div> @@ -2193,32 +2215,32 @@ CFLAGS= -xtarget=ultra -xarch=v9 <dd> <dl> - <dt><span class="sect2"><a href="#id2496865">4.1.1. + <dt><span class="sect2"><a href="#id2516529">4.1.1. Where to get binary packages</a></span></dt> - <dt><span class="sect2"><a href="#id2496905">4.1.2. + <dt><span class="sect2"><a href="#id2516569">4.1.2. How to use binary packages</a></span></dt> - <dt><span class="sect2"><a href="#id2497040">4.1.3. + <dt><span class="sect2"><a href="#id2516704">4.1.3. A word of warning</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2497051">4.2. + <dt><span class="sect1"><a href="#id2516715">4.2. Building packages from source</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2497129">4.2.1. + <dt><span class="sect2"><a href="#id2516725">4.2.1. Requirements</a></span></dt> - <dt><span class="sect2"><a href="#id2497149">4.2.2. + <dt><span class="sect2"><a href="#id2516745">4.2.2. Fetching distfiles</a></span></dt> - <dt><span class="sect2"><a href="#id2497202">4.2.3. + <dt><span class="sect2"><a href="#id2516866">4.2.3. How to build and install</a></span></dt> - <dt><span class="sect2"><a href="#id2498133">4.2.4. + <dt><span class="sect2"><a href="#id2517182">4.2.4. Selecting the compiler</a></span></dt> </dl> </dd> @@ -2245,30 +2267,31 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2496865" id= - "id2496865"></a>4.1.1. Where to get binary + <h3 class="title"><a name="id2516529" id= + "id2516529"></a>4.1.1. Where to get binary packages</h3> </div> </div> </div> <p>Precompiled packages are stored on ftp.NetBSD.org - and its mirrors in the directory <tt class= - "filename">/pub/NetBSD/packages</tt> for anonymous FTP - access. Please pick the right subdirectory there as - indicated by <span><b class="command">uname - -p</b></span>. In that directory, there is a + 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 - <tt class="filename">All</tt> which includes the actual - binaries in <tt class="filename">.tgz</tt> files. The - category subdirectories use symbolic links to those - files (this is the same directory layout as in - <tt class="filename">/usr/pkgsrc/packages</tt>).</p> + <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 distributions, only that the directory may be rooted - somewhere else, probably somewhere below <tt class= - "filename">/cdrom</tt>. Please consult your CDROMs + somewhere else, probably somewhere below <code class= + "filename">/cdrom</code>. Please consult your CDROMs documentation for the exact location.</p> </div> @@ -2276,8 +2299,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2496905" id= - "id2496905"></a>4.1.2. How to use binary + <h3 class="title"><a name="id2516569" id= + "id2516569"></a>4.1.2. How to use binary packages</h3> </div> </div> @@ -2285,43 +2308,44 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>If you have the files on a CDROM or downloaded them to your hard disk, youcan install them with the - following command (be sure to<span><b class= - "command">su</b></span> to root first):</p> + following command (be sure to<span><strong class= + "command">su</strong></span> to root first):</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>pkg_add /path/to/package.tgz</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>pkg_add /path/to/package.tgz</code></strong> </pre> <p>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 <span><b class= - "command">pkg_add</b></span> an FTP URL:</p> + you can do this automatically by giving + <span><strong class="command">pkg_add</strong></span> + an FTP URL:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>pkg_add ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSvers>/<arch>/All/package.tgz</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>pkg_add ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSvers>/<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><b class="command">uname - -rp</b></span>.</p> + 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, assuming they are present where you install from.</p> <p>After you've installed packages, be sure to have - <tt class="filename">/usr/pkg/bin</tt> in your - <tt class="varname">PATH</tt> so you can actually start - the just installed program.</p> + <code class="filename">/usr/pkg/bin</code> in your + <code class="varname">PATH</code> so you can actually + start the just installed program.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2497040" id= - "id2497040"></a>4.1.3. A word of + <h3 class="title"><a name="id2516704" id= + "id2516704"></a>4.1.3. A word of warning</h3> </div> </div> @@ -2344,7 +2368,7 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2497051" id="id2497051"></a>4.2. Building + "id2516715" id="id2516715"></a>4.2. Building packages from source</h2> </div> </div> @@ -2359,8 +2383,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2497129" id= - "id2497129"></a>4.2.1. Requirements</h3> + <h3 class="title"><a name="id2516725" id= + "id2516725"></a>4.2.1. Requirements</h3> </div> </div> </div> @@ -2379,8 +2403,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2497149" id= - "id2497149"></a>4.2.2. Fetching + <h3 class="title"><a name="id2516745" id= + "id2516745"></a>4.2.2. Fetching distfiles</h3> </div> </div> @@ -2396,33 +2420,33 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>You can overwrite some of the major distribution sites to fit to sites that are close to your own. Have - a look at <tt class= - "filename">pkgsrc/mk/bsd.pkg.defaults.mk</tt> to find - some examples - in particular, look for the <tt class= - "varname">MASTER_SORT</tt>, <tt class= - "varname">MASTER_SORT_REGEX</tt> and <tt class= - "varname">INET_COUNTRY</tt> definitions. This may save - some of your bandwidth and time.</p> + a look at <code class= + "filename">pkgsrc/mk/bsd.pkg.defaults.mk</code> to find + 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 + save some of your bandwidth and time.</p> <p>You can change these settings either in your shell's environment, or, if you want to keep the settings, by - editing the <tt class="filename">/etc/mk.conf</tt> + editing the <code class="filename">/etc/mk.conf</code> file, and adding the definitions there.</p> <p>If you don't have a permanent Internet connection and you want to know which files to download, - <span><b class="command">make fetch-list</b></span> - will tell you what you'll need. Put these distfiles - into <tt class= - "filename">/usr/pkgsrc/distfiles</tt>.</p> + <span><strong class="command">make + fetch-list</strong></span> will tell you what you'll + need. Put these distfiles into <code class= + "filename">/usr/pkgsrc/distfiles</code>.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2497202" id= - "id2497202"></a>4.2.3. How to build and + <h3 class="title"><a name="id2516866" id= + "id2516866"></a>4.2.3. How to build and install</h3> </div> </div> @@ -2430,19 +2454,20 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>Assuming that the distfile has been fetched (see previous section), become root and change into the - relevant directory and running <span><b class= - "command">make</b></span>. For example, type</p> + relevant directory and running <span><strong class= + "command">make</strong></span>. For example, type</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>cd misc/figlet</tt></b> -<tt class="prompt">%</tt> <b class="userinput"><tt>make</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>cd misc/figlet</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>make</code></strong> </pre> <p>at the shell prompt to build the various components of the package, and</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make install</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make install</code></strong> </pre> <p>to install the various components into the correct @@ -2459,35 +2484,39 @@ CFLAGS= -xtarget=ultra -xarch=v9 logs</i></a>.</p> <p>The program is installed under the default root of - the packages tree - <tt class="filename">/usr/pkg</tt>. - Should this not conform to your tastes, set the - <tt class="varname">LOCALBASE</tt> variable in your + the packages tree - <code class= + "filename">/usr/pkg</code>. Should this not conform to + your tastes, set the <code class= + "varname">LOCALBASE</code> variable in your environment, and it will use that value as the root of - your packages tree. So, to use <tt class= - "filename">/usr/local</tt>, set <tt class= - "varname">LOCALBASE=/usr/local</tt> in your + your packages tree. So, to use <code class= + "filename">/usr/local</code>, set <code class= + "varname">LOCALBASE=/usr/local</code> in your environment. Please note that you should use a directory which is dedicated to packages and not shared - with other programs (ie, do not try and use <tt class= - "varname">LOCALBASE=/usr</tt>). Also, you should not - try to add any of your own files or directories (such - as <tt class="filename">src/</tt>, <tt class= - "filename">obj/</tt>, or <tt class= - "filename">pkgsrc/</tt>) below the <tt class= - "varname">LOCALBASE</tt> tree. This is to prevent + with other programs (ie, do not try and use + <code class="varname">LOCALBASE=/usr</code>). Also, you + should not try to add any of your own files or + directories (such as <code class= + "filename">src/</code>, <code class= + "filename">obj/</code>, or <code class= + "filename">pkgsrc/</code>) below the <code class= + "varname">LOCALBASE</code> tree. This is to prevent possible conflicts between programs and other files installed by the package system and whatever else may have been installed there.</p> - <p>Some packages look in <tt class= - "filename">/etc/mk.conf</tt> to alter some + <p>Some packages look in <code class= + "filename">/etc/mk.conf</code> to alter some configuration options at build time. Have a look at - <tt class="filename">pkgsrc/mk/bsd.pkg.defaults.mk</tt> - to get an overview of what will be set there by - default. Environment variables such as <tt class= - "varname">LOCALBASE</tt> can be set in <tt class= - "filename">/etc/mk.conf</tt> to save having to remember - to set them each time you want to use pkgsrc.</p> + <code class= + "filename">pkgsrc/mk/bsd.pkg.defaults.mk</code> to get + an overview of what will be set there by default. + Environment variables such as <code class= + "varname">LOCALBASE</code> can be set in <code class= + "filename">/etc/mk.conf</code> to save having to + remember to set them each time you want to use + pkgsrc.</p> <p>Occasionally, people want to “<span class= "quote">look under the covers</span>” to see what @@ -2503,11 +2532,13 @@ CFLAGS= -xtarget=ultra -xarch=v9 "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">make</span>(1)</span></a> command - with <tt class="varname">PKG_DEBUG_LEVEL=2</tt>, - then a huge amount of information will be - displayed. For example,</p> + with <code class= + "varname">PKG_DEBUG_LEVEL=2</code>, then a huge + amount of information will be displayed. For + example,</p> <pre class="screen"> -<b class="userinput"><tt>make patch PKG_DEBUG_LEVEL=2</tt></b> +<strong class= +"userinput"><code>make patch PKG_DEBUG_LEVEL=2</code></strong> </pre> <p>will show all the commands that are invoked, @@ -2517,19 +2548,20 @@ CFLAGS= -xtarget=ultra -xarch=v9 <li> <p>If you want to know the value of a certain - make(1) definition, then the <tt class= - "varname">VARNAME</tt> definition should be used, - in conjunction with the show-var target. e.g. to - show the expansion of the <a href= + make(1) definition, then the <code class= + "varname">VARNAME</code> definition should be + used, in conjunction with the show-var target. + e.g. to show the expansion 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> - variable <tt class="varname">DISTFILES</tt>:</p> + variable <code class= + "varname">DISTFILES</code>:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>make show-var VARNAME=LOCALBASE</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>make show-var VARNAME=LOCALBASE</code></strong> /usr/pkg -<tt class="prompt">%</tt> +<code class="prompt">%</code> </pre> </li> @@ -2545,39 +2577,41 @@ CFLAGS= -xtarget=ultra -xarch=v9 "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">pkg_add</span>(1)</span></a>, else do a - <span><b class="command">make package</b></span>. The - list of remote FTP sites searched is kept in the - variable <tt class="varname">BINPKG_SITE</tt>, which - defaults to ftp.NetBSD.org. Any flags that should be - added to <a href= + <span><strong class="command">make + package</strong></span>. The list of remote FTP sites + searched is kept in the variable <code class= + "varname">BINPKG_SITE</code>, which defaults to + ftp.NetBSD.org. Any flags that should be added to + <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">pkg_add</span>(1)</span></a> can be put - into <tt class="varname">BIN_INSTALL_FLAGS</tt>. See - <tt class="filename">pkgsrc/mk/bsd.pkg.defaults.mk</tt> - for more details.</p> + into <code class="varname">BIN_INSTALL_FLAGS</code>. + See <code class= + "filename">pkgsrc/mk/bsd.pkg.defaults.mk</code> for + more details.</p> <p>A final word of warning: If you setup a system that - has a non-standard setting for <tt class= - "varname">LOCALBASE</tt>, be sure to set that before + has a non-standard setting for <code class= + "varname">LOCALBASE</code>, be sure to set that before any packages are installed, as you can not use several directories for the same purpose. Doing so will result in pkgsrc not being able to properly detect your installed packages, and fail miserably. Note also that precompiled binary packages are usually built with the - default <tt class="varname">LOCALBASE</tt> of - <tt class="filename">/usr/pkg</tt>, and that you should - <span class="emphasis"><em>not</em></span> install any - if you use a non-standard <tt class= - "varname">LOCALBASE</tt>.</p> + default <code class="varname">LOCALBASE</code> of + <code class="filename">/usr/pkg</code>, and that you + should <span class="emphasis"><em>not</em></span> + install any if you use a non-standard <code class= + "varname">LOCALBASE</code>.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2498133" id= - "id2498133"></a>4.2.4. Selecting the + <h3 class="title"><a name="id2517182" id= + "id2517182"></a>4.2.4. Selecting the compiler</h3> </div> </div> @@ -2589,8 +2623,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="variablelist"> <dl> - <dt><span class="term"><tt class= - "varname">PKGSRC_COMPILER</tt>:</span></dt> + <dt><span class="term"><code class= + "varname">PKGSRC_COMPILER</code>:</span></dt> <dd> <p>This is a list of values specifying the chain @@ -2600,33 +2634,33 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class="varname">distcc</tt>: + <p><code class="varname">distcc</code>: distributed C/C++ (chainable)</p> </li> <li> - <p><tt class="varname">ccache</tt>: + <p><code class="varname">ccache</code>: compiler cache (chainable)</p> </li> <li> - <p><tt class="varname">gcc</tt>: GNU C/C++ - Compiler</p> + <p><code class="varname">gcc</code>: GNU + C/C++ Compiler</p> </li> <li> - <p><tt class="varname">mipspro</tt>: + <p><code class="varname">mipspro</code>: Silicon Graphics, Inc. MIPSpro (n32/n64)</p> </li> <li> - <p><tt class="varname">mipspro</tt>: + <p><code class="varname">mipspro</code>: Silicon Graphics, Inc. MIPSpro (o32)</p> </li> <li> - <p><tt class="varname">sunpro</tt>: + <p><code class="varname">sunpro</code>: Microsystems, Inc. WorkShip/Forte/Sun ONE Studio</p> </li> @@ -2634,19 +2668,20 @@ CFLAGS= -xtarget=ultra -xarch=v9 </div> <p>The default is “<span class= - "quote"><tt class= - "varname">gcc</tt></span>”. You can use - <tt class="varname">ccache</tt> and/or <tt class= - "varname">distcc</tt> with an appropriate - <tt class="varname">PKGSRC_COMPILER</tt> setting, - e.g. “<span class="quote"><tt class= - "varname">ccache gcc</tt></span>”. This + "quote"><code class= + "varname">gcc</code></span>”. You can use + <code class="varname">ccache</code> and/or + <code class="varname">distcc</code> with an + appropriate <code class= + "varname">PKGSRC_COMPILER</code> setting, e.g. + “<span class="quote"><code class= + "varname">ccache gcc</code></span>”. This variable should always be terminated with a value for a real compiler.</p> </dd> - <dt><span class="term"><tt class= - "varname">GCC_REQD</tt>:</span></dt> + <dt><span class="term"><code class= + "varname">GCC_REQD</code>:</span></dt> <dd> <p>This specifies the minimum version of GCC to @@ -2676,10 +2711,10 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2563004">5.1. + <dt><span class="sect1"><a href="#id2517337">5.1. Building a single binary package</a></span></dt> - <dt><span class="sect1"><a href="#id2563082">5.2. + <dt><span class="sect1"><a href="#id2517825">5.2. Settings for creation of binary packages</a></span></dt> @@ -2692,34 +2727,34 @@ CFLAGS= -xtarget=ultra -xarch=v9 "#binary.configuration">5.3.1. Configuration</a></span></dt> - <dt><span class="sect2"><a href="#id2563222">5.3.2. + <dt><span class="sect2"><a href="#id2517964">5.3.2. Other environmental considerations</a></span></dt> - <dt><span class="sect2"><a href="#id2563262">5.3.3. + <dt><span class="sect2"><a href="#id2518005">5.3.3. Operation</a></span></dt> - <dt><span class="sect2"><a href="#id2563469">5.3.4. + <dt><span class="sect2"><a href="#id2583270">5.3.4. What it does</a></span></dt> - <dt><span class="sect2"><a href="#id2563526">5.3.5. + <dt><span class="sect2"><a href="#id2583326">5.3.5. Disk space requirements</a></span></dt> - <dt><span class="sect2"><a href="#id2563553">5.3.6. + <dt><span class="sect2"><a href="#id2583421">5.3.6. Setting up a sandbox for chroot'ed builds</a></span></dt> - <dt><span class="sect2"><a href="#id2563916">5.3.7. + <dt><span class="sect2"><a href="#id2583785">5.3.7. Building a partial set of packages</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2564027">5.4. + <dt><span class="sect1"><a href="#id2583828">5.4. Creating a multiple CD-ROM packages collection</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2564042">5.4.1. + <dt><span class="sect2"><a href="#id2583843">5.4.1. Example of cdpack</a></span></dt> </dl> </dd> @@ -2731,7 +2766,7 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2563004" id="id2563004"></a>5.1. Building a + "id2517337" id="id2517337"></a>5.1. Building a single binary package</h2> </div> </div> @@ -2750,28 +2785,29 @@ CFLAGS= -xtarget=ultra -xarch=v9 it.</p> <p>To create a binary package, change into the - appropriate directory in pkgsrc, and run <span><b class= - "command">make package</b></span>:</p> + appropriate directory in pkgsrc, and run + <span><strong class="command">make + package</strong></span>:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd misc/figlet</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make package</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd misc/figlet</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>make package</code></strong> </pre> <p>This will build and install your package (if not already done), and then build a binary package from what - was installed. You can then use the <span><b class= - "command">pkg_*</b></span> tools to manipulate it. Binary - packages are created by default in <tt class= - "filename">/usr/pkgsrc/packages</tt>, in the form of a + was installed. You can then use the <span><strong class= + "command">pkg_*</strong></span> tools to manipulate it. + Binary packages are created by default in <code class= + "filename">/usr/pkgsrc/packages</code>, in the form of a gzipped tar file. See <a href="#logs.package" title= "B.2. Packaging figlet">Section B.2, “Packaging figlet”</a> for a continuation of the above <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/misc/figlet/README.html" - class="pkgname">misc/figlet</a> example.</p> + class="pkgname">misc/figlet</a> example.</p> <p>See <a href="#submit" title= "Chapter 14. Submitting and Committing">Chapter @@ -2784,7 +2820,7 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2563082" id="id2563082"></a>5.2. Settings + "id2517825" id="id2517825"></a>5.2. Settings for creation of binary packages</h2> </div> </div> @@ -2841,14 +2877,14 @@ CFLAGS= -xtarget=ultra -xarch=v9 </div> </div> - <p>You may want to set things in <tt class= - "filename">/etc/mk.conf</tt>. Look at <tt class= - "filename">pkgsrc/mk/bsd.pkg.defaults.mk</tt> for + <p>You may want to set things in <code class= + "filename">/etc/mk.conf</code>. Look at <code class= + "filename">pkgsrc/mk/bsd.pkg.defaults.mk</code> for details of the default settings. You will want to - ensure that <tt class= - "varname">ACCEPTABLE_LICENSES</tt> meet your local - policy. As used in this example, <tt class= - "varname">_ACCEPTABLE=yes</tt> accepts <span class= + ensure that <code class= + "varname">ACCEPTABLE_LICENSES</code> meet your local + policy. As used in this example, <code class= + "varname">_ACCEPTABLE=yes</code> accepts <span class= "emphasis"><em>all</em></span> licenses.</p> <pre class="programlisting"> PACKAGES?= ${_PKGSRCDIR}/packages/${MACHINE_ARCH} @@ -2866,17 +2902,17 @@ _ACCEPTABLE= yes <div class="titlepage"> <div> <div> - <h4 class="title"><a name="id2563146" id= - "id2563146"></a>5.3.1.2. <tt class= - "filename">build.conf</tt></h4> + <h4 class="title"><a name="id2517889" id= + "id2517889"></a>5.3.1.2. <code class= + "filename">build.conf</code></h4> </div> </div> </div> - <p>In <tt class="filename">pkgsrc/mk/bulk</tt>, copy - <tt class="filename">build.conf-example</tt> to - <tt class="filename">build.conf</tt> and edit it, - following the comments in that file. This is the + <p>In <code class="filename">pkgsrc/mk/bulk</code>, + copy <code class="filename">build.conf-example</code> + to <code class="filename">build.conf</code> and edit + it, following the comments in that file. This is the config file that determines where log files are generated after the build, where to mail the build report to, where your pkgsrc tree is located and @@ -2884,33 +2920,34 @@ _ACCEPTABLE= yes "http://netbsd.gw.com/cgi-bin/man-cgi?su+8+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">su</span>(8)</span></a> to to do a - <span><b class="command">cvs update</b></span>.</p> + <span><strong class="command">cvs + update</strong></span>.</p> </div> <div class="sect3" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h4 class="title"><a name="id2563182" id= - "id2563182"></a>5.3.1.3. <tt class= - "filename">pre-build.local</tt></h4> + <h4 class="title"><a name="id2517925" id= + "id2517925"></a>5.3.1.3. <code class= + "filename">pre-build.local</code></h4> </div> </div> </div> <p>It is possible to configure the bulk build to perform certain site specific tasks at the end of the - pre-build stage. If the file <tt class= - "filename">pre-build.local</tt> exists in <tt class= - "filename">/usr/pkgsrc/mk/bulk</tt> it will be - executed (as a sh(1) script) at the end of the usual - pre-build stage. An example use of <tt class= - "filename">pre-build.local</tt> is to have the - line:</p> + pre-build stage. If the file <code class= + "filename">pre-build.local</code> exists in + <code class="filename">/usr/pkgsrc/mk/bulk</code> it + will be executed (as a sh(1) script) at the end of + the usual pre-build stage. An example use of + <code class="filename">pre-build.local</code> is to + have the line:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>echo "I do not have enough disk space to build this pig." \ - > pkgsrc/games/crafty-book-enormous/$BROKENF</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>echo "I do not have enough disk space to build this pig." \ + > pkgsrc/games/crafty-book-enormous/$BROKENF</code></strong> </pre> <p>to prevent the system from trying to build a @@ -2923,30 +2960,31 @@ _ACCEPTABLE= yes <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2563222" id= - "id2563222"></a>5.3.2. Other environmental + <h3 class="title"><a name="id2517964" id= + "id2517964"></a>5.3.2. Other environmental considerations</h3> </div> </div> </div> - <p>As <tt class="filename">/usr/pkg</tt> will be + <p>As <code class="filename">/usr/pkg</code> will be completely deleted at the start of bulk builds, make sure your login shell is placed somewhere else. Either - drop it into <tt class="filename">/usr/local/bin</tt> - (and adjust your login shell in the passwd file), or - (re-)install it via <a href= + drop it into <code class= + "filename">/usr/local/bin</code> (and adjust your login + shell in the passwd file), or (re-)install it via + <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">pkg_add</span>(1)</span></a> from - <tt class="filename">/etc/rc.local</tt>, so you can + <code class="filename">/etc/rc.local</code>, so you can login after a reboot (remember that your current process won't die if the package is removed, you just can't start any new instances of the shell any more). Also, if you use NetBSD earlier than 1.5, or you still want to use the pkgsrc version of ssh for some reason, be sure to install ssh before starting it from - <tt class="filename">rc.local</tt>:</p> + <code class="filename">rc.local</code>:</p> <pre class="programlisting"> ( cd /usr/pkgsrc/security/ssh ; make bulk-install ) if [ -f /usr/pkg/etc/rc.d/sshd ]; then @@ -2964,8 +3002,8 @@ fi <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2563262" id= - "id2563262"></a>5.3.3. Operation</h3> + <h3 class="title"><a name="id2518005" id= + "id2518005"></a>5.3.3. Operation</h3> </div> </div> </div> @@ -2984,35 +3022,35 @@ fi <p>Be sure to remove all other things that might interfere with builds, like some libs installed in - <tt class="filename">/usr/local</tt>, etc. then become - root and type:</p> + <code class="filename">/usr/local</code>, etc. then + become root and type:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd /usr/pkgsrc</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>sh mk/bulk/build</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd /usr/pkgsrc</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>sh mk/bulk/build</code></strong> </pre> <p>If for some reason your last build didn't complete (power failure, system panic, ...), you can continue it by running:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>sh mk/bulk/build restart</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>sh mk/bulk/build restart</code></strong> </pre> <p>At the end of the bulk build, you will get a summary via mail, and find build logs in the directory - specified by <tt class="varname">FTP</tt> in the - <tt class="filename">build.conf</tt> file.</p> + specified by <code class="varname">FTP</code> in the + <code class="filename">build.conf</code> file.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2563469" id= - "id2563469"></a>5.3.4. What it does</h3> + <h3 class="title"><a name="id2583270" id= + "id2583270"></a>5.3.4. What it does</h3> </div> </div> </div> @@ -3045,33 +3083,33 @@ fi <dd> <p>Generates a report that's placed in the - directory specified in the <tt class= - "filename">build.conf</tt> file named <tt class= - "filename">broken.html</tt>, a short version of - that report will also be mailed to the build's - admin.</p> + directory specified in the <code class= + "filename">build.conf</code> file named + <code class="filename">broken.html</code>, a + short version of that report will also be mailed + to the build's admin.</p> </dd> </dl> </div> <p>During the build, a list of broken packages will be - compiled in <tt class= - "filename">/usr/pkgsrc/.broken</tt> (or <tt class= - "filename">.../.broken.${MACHINE}</tt> if <tt class= - "varname">OBJMACHINE</tt> is set), individual build - logs of broken builds can be found in the package's - directory. These files are used by the bulk-targets to - mark broken builds to not waste time trying to rebuild - them, and they can be used to debug these broken - package builds later.</p> + compiled in <code class= + "filename">/usr/pkgsrc/.broken</code> (or <code class= + "filename">.../.broken.${MACHINE}</code> if + <code class="varname">OBJMACHINE</code> is set), + individual build logs of broken builds can be found in + the package's directory. These files are used by the + bulk-targets to mark broken builds to not waste time + trying to rebuild them, and they can be used to debug + these broken package builds later.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2563526" id= - "id2563526"></a>5.3.5. Disk space + <h3 class="title"><a name="id2583326" id= + "id2583326"></a>5.3.5. Disk space requirements</h3> </div> </div> @@ -3113,8 +3151,8 @@ fi <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2563553" id= - "id2563553"></a>5.3.6. Setting up a sandbox + <h3 class="title"><a name="id2583421" id= + "id2583421"></a>5.3.6. Setting up a sandbox for chroot'ed builds</h3> </div> </div> @@ -3126,42 +3164,41 @@ fi inside a chroot environment.</p> <p>The first step to do so is setting up a chroot - sandbox, e.g. <tt class="filename">/usr/sandbox</tt>. - After extracting all the sets from a NetBSD - installation or doing a <span><b class="command">make - distribution DESTDIR=/usr/sandbox</b></span> in - <tt class="filename">/usr/src/etc</tt>, be sure the - following items are present and properly - configured:</p> + sandbox, e.g. <code class= + "filename">/usr/sandbox</code>. After extracting all + the sets from a NetBSD installation or doing a + <span><strong class="command">make distribution + DESTDIR=/usr/sandbox</strong></span> in <code class= + "filename">/usr/src/etc</code>, be sure the following + items are present and properly configured:</p> <div class="procedure"> <ol type="1"> <li> <p>Kernel</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cp /netbsd /usr/sandbox</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cp /netbsd /usr/sandbox</code></strong> </pre> </li> <li> - <p><tt class="filename">/dev/*</tt></p> + <p><code class="filename">/dev/*</code></p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd /usr/sandbox/dev ; sh MAKEDEV all</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd /usr/sandbox/dev ; sh MAKEDEV all</code></strong> </pre> </li> <li> - <p><tt class="filename">/etc/resolv.conf</tt> + <p><code class="filename">/etc/resolv.conf</code> (for <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/smtpd/README.html" - class="pkgname">security/smtpd</a> and - mail):</p> + class="pkgname">security/smtpd</a> and mail):</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cp /etc/resolv.conf /usr/sandbox/etc</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cp /etc/resolv.conf /usr/sandbox/etc</code></strong> </pre> </li> @@ -3169,68 +3206,67 @@ fi <p>Working(!) mail config (hostname, sendmail.cf):</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cp /etc/mail/sendmail.cf /usr/sandbox/etc/mail</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cp /etc/mail/sendmail.cf /usr/sandbox/etc/mail</code></strong> </pre> </li> <li> - <p><tt class="filename">/etc/localtime</tt> (for - <a xmlns= + <p><code class="filename">/etc/localtime</code> + (for <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/smtpd/README.html" - class="pkgname">security/smtpd</a>):</p> + class="pkgname">security/smtpd</a>):</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>ln -sf /usr/share/zoneinfo/UTC /usr/sandbox/etc/localtime</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>ln -sf /usr/share/zoneinfo/UTC /usr/sandbox/etc/localtime</code></strong> </pre> </li> <li> - <p><tt class="filename">/usr/src</tt> (system + <p><code class="filename">/usr/src</code> (system sources, for <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/sysutils/aperture/README.html" - class="pkgname">sysutils/aperture</a>, - <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" - href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/net/ppp-mppe/README.html" - class="pkgname">net/ppp-mppe</a>):</p> + class="pkgname">sysutils/aperture</a>, <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/net/ppp-mppe/README.html" + class="pkgname">net/ppp-mppe</a>):</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>ln -s ../disk1/cvs .</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>ln -s cvs/src-1.6 src</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>ln -s ../disk1/cvs .</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>ln -s cvs/src-1.6 src</code></strong> </pre> </li> <li> - <p>Create <tt class="filename">/var/db/pkg</tt> - (not part of default install):</p> + <p>Create <code class= + "filename">/var/db/pkg</code> (not part of + default install):</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mkdir /usr/sandbox/var/db/pkg</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>mkdir /usr/sandbox/var/db/pkg</code></strong> </pre> </li> <li> - <p>Create <tt class="filename">/usr/pkg</tt> (not - part of default install):</p> + <p>Create <code class="filename">/usr/pkg</code> + (not part of default install):</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mkdir /usr/sandbox/usr/pkg</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>mkdir /usr/sandbox/usr/pkg</code></strong> </pre> </li> <li> - <p>Checkout pkgsrc via cvs into <tt class= - "filename">/usr/sandbox/usr/pkgsrc</tt>:</p> + <p>Checkout pkgsrc via cvs into <code class= + "filename">/usr/sandbox/usr/pkgsrc</code>:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd /usr/sandbox/usr</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -d -P pkgsrc</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd /usr/sandbox/usr</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -d -P pkgsrc</code></strong> </pre> <p>Do not mount/link this to the copy of your @@ -3239,32 +3275,33 @@ fi </li> <li> - <p>Make <tt class= - "filename">/usr/sandbox/usr/pkgsrc/packages</tt> - and <tt class="filename">.../distfiles</tt> point - somewhere appropriate. NFS- and/or nullfs-mounts - may come in handy!</p> + <p>Make <code class= + "filename">/usr/sandbox/usr/pkgsrc/packages</code> + and <code class="filename">.../distfiles</code> + point somewhere appropriate. NFS- and/or + nullfs-mounts may come in handy!</p> </li> <li> - <p>Edit <tt class="filename">/etc/mk.conf</tt>, - see <a href="#binary.mk.conf" title= + <p>Edit <code class= + "filename">/etc/mk.conf</code>, see <a href= + "#binary.mk.conf" title= "5.3.1.1. /etc/mk.conf">Section 5.3.1.1, “/etc/mk.conf”</a>.</p> </li> <li> - <p>Adjust <tt class= - "filename">mk/bulk/build.conf</tt> to suit your + <p>Adjust <code class= + "filename">mk/bulk/build.conf</code> to suit your needs.</p> </li> <li> - <p>If you have set <tt class= - "varname">CVS_USER</tt> in <tt class= - "filename">build.conf</tt>, make sure that - account exists and can do a <span><b class= - "command">cvs ${CVS_FLAGS} update</b></span> + <p>If you have set <code class= + "varname">CVS_USER</code> in <code class= + "filename">build.conf</code>, make sure that + account exists and can do a <span><strong class= + "command">cvs ${CVS_FLAGS} update</strong></span> properly!</p> </li> </ol> @@ -3273,17 +3310,17 @@ fi <p>When the chroot sandbox is setup, you can start the build with the following steps:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd /usr/sandbox/usr/pkgsrc</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>sh mk/bulk/do-sandbox-build</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd /usr/sandbox/usr/pkgsrc</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>sh mk/bulk/do-sandbox-build</code></strong> </pre> <p>This will just jump inside the sandbox and start building. At the end of the build, mail will be sent with the results of the build. Created binary pkgs will - be in <tt class= - "filename">/usr/sandbox/usr/pkgsrc/packages</tt> + be in <code class= + "filename">/usr/sandbox/usr/pkgsrc/packages</code> (wherever that points/mounts to/from).</p> </div> @@ -3291,20 +3328,20 @@ fi <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2563916" id= - "id2563916"></a>5.3.7. Building a partial + <h3 class="title"><a name="id2583785" id= + "id2583785"></a>5.3.7. Building a partial set of packages</h3> </div> </div> </div> <p>In addition to building a complete set of all - packages in pkgsrc, the <tt class= - "filename">pkgsrc/mk/bulk/build</tt> script may be used - to build a subset of the packages contained in pkgsrc. - By setting defining <tt class= - "varname">SPECIFIC_PKGS</tt> in <tt class= - "filename">/etc/mk.conf</tt>, the variables</p> + packages in pkgsrc, the <code class= + "filename">pkgsrc/mk/bulk/build</code> script may be + used to build a subset of the packages contained in + pkgsrc. By setting defining <code class= + "varname">SPECIFIC_PKGS</code> in <code class= + "filename">/etc/mk.conf</code>, the variables</p> <div class="itemizedlist"> <ul type="disc"> @@ -3332,7 +3369,7 @@ fi explicitly listed packages.</p> <p>One use of this is to do a bulk build with - <tt class="varname">SPECIFIC_PKGS</tt> in a chroot + <code class="varname">SPECIFIC_PKGS</code> in a chroot sandbox periodically to have a complete set of the binary packages needed for your site available without the overhead of building extra packages that are not @@ -3345,7 +3382,7 @@ fi <div> <div> <h2 class="title" style="clear: both"><a name= - "id2564027" id="id2564027"></a>5.4. Creating a + "id2583828" id="id2583828"></a>5.4. Creating a multiple CD-ROM packages collection</h2> </div> </div> @@ -3357,19 +3394,19 @@ fi machines. The <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/cdpack/README.html" - class="pkgname">pkgtools/cdpack</a> package provides a - simple tool for creating the ISO 9660 images. - <span><b class="command">cdpack</b></span> arranges - the packages on the CD-ROMs in a way that keeps all - the dependencies for given package on the same CD as - that package.</p> + class="pkgname">pkgtools/cdpack</a> package provides a + simple tool for creating the ISO 9660 images. + <span><strong class="command">cdpack</strong></span> + arranges the packages on the CD-ROMs in a way that keeps + all the dependencies for given package on the same CD as + that package.</p> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2564042" id= - "id2564042"></a>5.4.1. Example of + <h3 class="title"><a name="id2583843" id= + "id2583843"></a>5.4.1. Example of cdpack</h3> </div> </div> @@ -3377,51 +3414,51 @@ fi <p>Complete documentation for cdpack is found in the cdpack(1) manpage. The following short example assumes - that the binary packages are left in <tt class= - "filename">/usr/pkgsrc/packages/All</tt> and that - sufficient disk space exists in <tt class= - "filename">/u2</tt> to hold the ISO 9660 images.</p> + that the binary packages are left in <code class= + "filename">/usr/pkgsrc/packages/All</code> and that + sufficient disk space exists in <code class= + "filename">/u2</code> to hold the ISO 9660 images.</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mkdir /u2/images</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>pkg_add /usr/pkgsrc/packages/All/cdpack</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cdpack /usr/pkgsrc/packages/All /u2/images</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>mkdir /u2/images</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>pkg_add /usr/pkgsrc/packages/All/cdpack</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>cdpack /usr/pkgsrc/packages/All /u2/images</code></strong> </pre> <p>If you wish to include a common set of files - (<tt class="filename">COPYRIGHT</tt>, <tt class= - "filename">README</tt>, etc.) on each CD in the + (<code class="filename">COPYRIGHT</code>, <code class= + "filename">README</code>, etc.) on each CD in the collection, then you need to create a directory which contains these files. e.g.</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mkdir /tmp/common</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>echo "This is a README" > /tmp/common/README</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>echo "Another file" > /tmp/common/COPYING</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mkdir /tmp/common/bin</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>echo "#!/bin/sh" > /tmp/common/bin/myscript</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>echo "echo Hello world" >> /tmp/common/bin/myscript</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>chmod 755 /tmp/common/bin/myscript</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>mkdir /tmp/common</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>echo "This is a README" > /tmp/common/README</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>echo "Another file" > /tmp/common/COPYING</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mkdir /tmp/common/bin</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>echo "#!/bin/sh" > /tmp/common/bin/myscript</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>echo "echo Hello world" >> /tmp/common/bin/myscript</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>chmod 755 /tmp/common/bin/myscript</code></strong> </pre> <p>Now create the images:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cdpack -x /tmp/common /usr/pkgsrc/packages/All /u2/images</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cdpack -x /tmp/common /usr/pkgsrc/packages/All /u2/images</code></strong> </pre> - <p>Each image will contain <tt class= - "filename">README</tt>, <tt class= - "filename">COPYING</tt>, and <tt class= - "filename">bin/myscript</tt> in their root + <p>Each image will contain <code class= + "filename">README</code>, <code class= + "filename">COPYING</code>, and <code class= + "filename">bin/myscript</code> in their root directories.</p> </div> </div> @@ -3442,43 +3479,47 @@ fi <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2564301">6.1. Is + <dt><span class="sect1"><a href="#id2584170">6.1. Is there a mailing list for pkg-related discussion?</a></span></dt> - <dt><span class="sect1"><a href="#id2564331">6.2. + <dt><span class="sect1"><a href="#id2584200">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="#id2564584">6.4. How + <dt><span class="sect1"><a href="#id2584453">6.4. How to use pkgsrc as non-root</a></span></dt> - <dt><span class="sect1"><a href="#id2564596">6.5. How + <dt><span class="sect1"><a href="#id2584465">6.5. How can I install/use XFree86 from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2564624">6.6. How + <dt><span class="sect1"><a href="#id2584492">6.6. How can I install/use X.org from pkgsrc?</a></span></dt> - <dt><span class="sect1"><a href="#id2564651">6.7. How + <dt><span class="sect1"><a href="#id2584520">6.7. How to fetch files from behind a firewall</a></span></dt> - <dt><span class="sect1"><a href="#id2564665">6.8. How - do I tell make fetch to do passive FTP?</a></span></dt> + <dt><span class="sect1"><a href="#id2584534">6.8. 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="#id2564785">6.9. How + <dt><span class="sect1"><a href="#id2584722">6.9. How to fetch all distfiles at once</a></span></dt> - <dt><span class="sect1"><a href="#id2564993">6.10. What - does Don't know how to make /usr/share/tmac/tmac.andoc + <dt><span class="sect1"><a href="#id2584861">6.10. 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="#id2565031">6.11. What - does Could not find bsd.own.mk mean?</a></span></dt> + <dt><span class="sect1"><a href="#id2584900">6.11. What + does “<span class="quote">Could not find + bsd.own.mk</span>” mean?</a></span></dt> - <dt><span class="sect1"><a href="#id2565089">6.12. + <dt><span class="sect1"><a href="#id2584957">6.12. Using 'sudo' with pkgsrc</a></span></dt> <dt><span class="sect1"><a href="#faq.conf">6.13. @@ -3500,19 +3541,19 @@ fi <div> <div> <h2 class="title" style="clear: both"><a name= - "id2564301" id="id2564301"></a>6.1. Is there a + "id2584170" id="id2584170"></a>6.1. Is there a mailing list for pkg-related discussion?</h2> </div> </div> </div> - <p>Yes, <tt class="email"><<a href= - "mailto:tech-pkg@NetBSD.org">tech-pkg@NetBSD.org</a>></tt> + <p>Yes, <code class="email"><<a href= + "mailto:tech-pkg@NetBSD.org">tech-pkg@NetBSD.org</a>></code> is the list for discussing package related issues. To subscribe do:</p> <pre class="programlisting"> -<tt class= -"prompt">%</tt> echo subscribe tech-pkg | mail majordomo@NetBSD.org +<code class= +"prompt">%</code> echo subscribe tech-pkg | mail majordomo@NetBSD.org </pre> <p>An archive of the list is available at <a href= @@ -3525,15 +3566,15 @@ fi <div> <div> <h2 class="title" style="clear: both"><a name= - "id2564331" id="id2564331"></a>6.2. Where's + "id2584200" id="id2584200"></a>6.2. Where's the pkgviews documentation?</h2> </div> </div> </div> <p>Pkgviews is tightly integrated with buildlink. You can - find a pkgviews User's guide in <tt class= - "filename">pkgsrc/mk/buildlink3/PKGVIEWS_UG</tt>.</p> + find a pkgviews User's guide in <code class= + "filename">pkgsrc/mk/buildlink3/PKGVIEWS_UG</code>.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -3548,7 +3589,7 @@ fi </div> </div> - <p>The <tt class="filename">pkgsrc/pkgtools</tt> + <p>The <code class="filename">pkgsrc/pkgtools</code> directory pkgtools contains a number of useful utilities for both users and developers of pkgsrc. This section attempts only to make the reader aware of the utilities @@ -3564,8 +3605,8 @@ fi <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/x11-links/README.html" - class="pkgname">pkgtools/x11-links</a>: symlinks - for use by buildlink</p> + class="pkgname">pkgtools/x11-links</a>: symlinks + for use by buildlink</p> </li> </ul> </div> @@ -3579,34 +3620,34 @@ fi <p><a xmlns= "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> + class="pkgname">pkgtools/digest</a>: calculates + SHA1 checksums (and other kinds)</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>: compat + library for pkg tools</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/mtree/README.html" - class="pkgname">pkgtools/mtree</a>: installed on - non-BSD systems due to lack of native mtree</p> + class="pkgname">pkgtools/mtree</a>: installed on + non-BSD systems due to lack of native mtree</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_install/README.html" - class="pkgname">pkgtools/pkg_install</a>: - up-to-date replacement for - /usr/sbin/pkg_install, or for use on operating - systems where pkg_install is not present</p> + class="pkgname">pkgtools/pkg_install</a>: + up-to-date replacement for /usr/sbin/pkg_install, + or for use on operating systems where pkg_install + is not present</p> </li> </ul> </div> @@ -3620,38 +3661,37 @@ fi <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "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> + 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> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/dfdisk/README.html" - class="pkgname">pkgtools/dfdisk</a>: adds extra - functionality to pkgsrc, allowing it to fetch - distfiles from multiple locations. It currently - supports the following methods: multiple CD-ROMs - and network FTP/HTTP connections.</p> + class="pkgname">pkgtools/dfdisk</a>: adds extra + functionality to pkgsrc, allowing it to fetch + distfiles from multiple locations. It currently + supports the following methods: multiple CD-ROMs + and network FTP/HTTP connections.</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/xpkgwedge/README.html" - class="pkgname">pkgtools/xpkgwedge</a>: put X11 - packages someplace else (enabled by default)</p> + class="pkgname">pkgtools/xpkgwedge</a>: put X11 + packages someplace else (enabled by default)</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/cpuflags/README.html" - class="pkgname">devel/cpuflags</a>: will - determine the best compiler flags to optimise - code for your current CPU and compiler.</p> + class="pkgname">devel/cpuflags</a>: will determine + the best compiler flags to optimise code for your + current CPU and compiler.</p> </li> </ul> </div> @@ -3665,46 +3705,45 @@ fi <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>: installs + pkg_chk, which reports on packages whose installed + versions do not match the latest pkgsrc entries</p> </li> <li> <p><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>: makes - dependency graphs of packages, to aid in - choosing a strategy for updating</p> + class="pkgname">pkgtools/pkgdep</a>: makes + dependency graphs of packages, to aid in choosing a + strategy for updating</p> </li> <li> <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>: make + graph from above (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>: 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> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgsurvey/README.html" - class="pkgname">pkgtools/pkgsurvey</a>: report - what packages you have installed</p> + class="pkgname">pkgtools/pkgsurvey</a>: report what + packages you have installed</p> </li> </ul> </div> @@ -3718,28 +3757,28 @@ fi <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdiff/README.html" - class="pkgname">pkgtools/pkgdiff</a>: automate - making and maintaining patches for a package - (includes pkgdiff, pkgvi, mkpatches, ...)</p> + class="pkgname">pkgtools/pkgdiff</a>: automate + making and maintaining patches for a package + (includes pkgdiff, pkgvi, mkpatches, ...)</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/rpm2pkg/README.html" - class="pkgname">pkgtools/rpm2pkg</a>, <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/url2pkg/README.html" - class="pkgname">pkgtools/url2pkg</a>: aids in - converting to pkgsrc</p> + class="pkgname">pkgtools/rpm2pkg</a>, <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/url2pkg/README.html" + class="pkgname">pkgtools/url2pkg</a>: aids in + converting to pkgsrc</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/gensolpkg/README.html" - class="pkgname">pkgtools/gensolpkg</a>: convert - pkgsrc to a Solaris package</p> + class="pkgname">pkgtools/gensolpkg</a>: convert + pkgsrc to a Solaris package</p> </li> </ul> </div> @@ -3753,25 +3792,25 @@ fi <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgconflict/README.html" - class="pkgname">pkgtools/pkgconflict</a>: find - packages that conflict but aren't marked as - such</p> + class="pkgname">pkgtools/pkgconflict</a>: find + packages that conflict but aren't marked as + such</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_comp/README.html" - class="pkgname">pkgtools/pkg_comp</a>: build - packages in a chrooted area</p> + class="pkgname">pkgtools/pkg_comp</a>: build + packages in a chrooted area</p> </li> <li> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/libkver/README.html" - class="pkgname">pkgtools/libkver</a>: spoof - kernel version for chrooted cross builds</p> + class="pkgname">pkgtools/libkver</a>: spoof kernel + version for chrooted cross builds</p> </li> </ul> </div> @@ -3782,7 +3821,7 @@ fi <div> <div> <h2 class="title" style="clear: both"><a name= - "id2564584" id="id2564584"></a>6.4. How to use + "id2584453" id="id2584453"></a>6.4. How to use pkgsrc as non-root</h2> </div> </div> @@ -3792,7 +3831,7 @@ fi set some variables to make pkgsrc work under these conditions. Please see <a href= "http://mail-index.NetBSD.org/tech-pkg/2003/09/27/0023.html" - target="_top">this message</a> for more details.</p> + target="_top">this message</a> for more details.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -3800,17 +3839,18 @@ fi <div> <div> <h2 class="title" style="clear: both"><a name= - "id2564596" id="id2564596"></a>6.5. How can I + "id2584465" id="id2584465"></a>6.5. How can I install/use XFree86 from pkgsrc?</h2> </div> </div> </div> <p>If you want to use XFree86 from pkgsrc instead of your - system's own X11 (<tt class="filename">/usr/X11R6</tt>, - <tt class="filename">/usr/openwin</tt>, ...), you will - have to add the following lines into <tt class= - "filename">mk.conf</tt>:</p> + system's own X11 (<code class= + "filename">/usr/X11R6</code>, <code class= + "filename">/usr/openwin</code>, ...), you will have to + add the following lines into <code class= + "filename">mk.conf</code>:</p> <pre class="programlisting"> X11_TYPE=XFree86 @@ -3822,17 +3862,18 @@ fi <div> <div> <h2 class="title" style="clear: both"><a name= - "id2564624" id="id2564624"></a>6.6. How can I + "id2584492" id="id2584492"></a>6.6. How can I install/use X.org from pkgsrc?</h2> </div> </div> </div> <p>If you want to use X.org from pkgsrc instead of your - system's own X11 (<tt class="filename">/usr/X11R6</tt>, - <tt class="filename">/usr/openwin</tt>, ...) you will - have to add the following lines into <tt class= - "filename">mk.conf</tt>:</p> + system's own X11 (<code class= + "filename">/usr/X11R6</code>, <code class= + "filename">/usr/openwin</code>, ...) you will have to add + the following lines into <code class= + "filename">mk.conf</code>:</p> <pre class="programlisting"> X11_TYPE=xorg @@ -3844,7 +3885,7 @@ fi <div> <div> <h2 class="title" style="clear: both"><a name= - "id2564651" id="id2564651"></a>6.7. How to + "id2584520" id="id2584520"></a>6.7. How to fetch files from behind a firewall</h2> </div> </div> @@ -3869,33 +3910,33 @@ http_proxy=http://orpheus.amdahl.com:80/ <div> <div> <h2 class="title" style="clear: both"><a name= - "id2564665" id="id2564665"></a>6.8. How do I - tell <span><b class="command">make fetch</b></span> - to do passive FTP?</h2> + "id2584534" id="id2584534"></a>6.8. How do I + tell <span><strong class="command">make + fetch</strong></span> to do passive FTP?</h2> </div> </div> </div> <p>This depends on which utility is used to retrieve - distfiles. From <tt class="filename">bsd.pkg.mk</tt>, - <tt class="varname">FETCH_CMD</tt> is assigned the first - available command from the following list:</p> + distfiles. From <code class="filename">bsd.pkg.mk</code>, + <code class="varname">FETCH_CMD</code> is assigned the + first available command from the following list:</p> <pre class="programlisting"> ${LOCALBASE}/bin/ftp /usr/bin/ftp </pre> <p>On a default NetBSD installation, this will be - <tt class="filename">/usr/bin/ftp</tt>, which + <code class="filename">/usr/bin/ftp</code>, which automatically tries passive connections first, and falls back to active connections if the server refuses to do passive. For the other tools, add the following to your - <tt class="filename">/etc/mk.conf</tt> file: <tt class= - "varname">PASSIVE_FETCH=1</tt>.</p> + <code class="filename">/etc/mk.conf</code> file: + <code class="varname">PASSIVE_FETCH=1</code>.</p> - <p>Having that option present will prevent <tt class= - "filename">/usr/bin/ftp</tt> from falling back to active - transfers.</p> + <p>Having that option present will prevent <code class= + "filename">/usr/bin/ftp</code> from falling back to + active transfers.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -3903,7 +3944,7 @@ ${LOCALBASE}/bin/ftp <div> <div> <h2 class="title" style="clear: both"><a name= - "id2564785" id="id2564785"></a>6.9. How to + "id2584722" id="id2584722"></a>6.9. How to fetch all distfiles at once</h2> </div> </div> @@ -3911,57 +3952,59 @@ ${LOCALBASE}/bin/ftp <p>You would like to download all the distfiles in a single batch from work or university, where you can't run - a <span><b class="command">make fetch</b></span>. There - is an archive of distfiles on <a href= + a <span><strong class="command">make + fetch</strong></span>. There is an archive of distfiles + on <a href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/" target="_top">ftp.NetBSD.org</a>, but downloading the entire directory may not be appropriate.</p> - <p>The answer here is to do a <span><b class= - "command">make fetch-list</b></span> in <tt class= - "filename">/usr/pkgsrc</tt> or one of it's + <p>The answer here is to do a <span><strong class= + "command">make fetch-list</strong></span> in <code class= + "filename">/usr/pkgsrc</code> or one of it's subdirectories, carry the resulting list to your machine at work/school and use it there If you don't have a NetBSD-compatible ftp(1) (like lukemftp) at work, don't - forget to set <tt class="varname">FETCH_CMD</tt> to + forget to set <code class="varname">FETCH_CMD</code> to something that fetches a URL:</p> <p>At home:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>cd /usr/pkgsrc</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>make fetch-list FETCH_CMD=wget DISTDIR=/tmp/distfiles >/tmp/fetch.sh</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>scp /tmp/fetch.sh work:/tmp</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>cd /usr/pkgsrc</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>make fetch-list FETCH_CMD=wget DISTDIR=/tmp/distfiles >/tmp/fetch.sh</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>scp /tmp/fetch.sh work:/tmp</code></strong> </pre> <p>At work:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>sh /tmp/fetch.sh</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>sh /tmp/fetch.sh</code></strong> </pre> - <p>then tar up <tt class="filename">/tmp/distfiles</tt> - and take it home.</p> + <p>then tar up <code class= + "filename">/tmp/distfiles</code> and take it home.</p> <p>If you have a machine running NetBSD, and you want to get <span class="emphasis"><em>all</em></span> distfiles (even ones that aren't for your machine architecture), you can do so by using the above-mentioned - <span><b class="command">make fetch-list</b></span> - approach, or fetch the distfiles directly by running:</p> + <span><strong class="command">make + fetch-list</strong></span> approach, or fetch the + distfiles directly by running:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>make mirror-distfiles</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>make mirror-distfiles</code></strong> </pre> - <p>If you even decide to ignore <tt class= - "varname">NO_{SRC,BIN}_ON_{FTP,CDROM}</tt>, then you can - get everything by running:</p> + <p>If you even decide to ignore <code class= + "varname">NO_{SRC,BIN}_ON_{FTP,CDROM}</code>, then you + can get everything by running:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>make fetch NO_SKIP=yes</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>make fetch NO_SKIP=yes</code></strong> </pre> </div> @@ -3970,7 +4013,7 @@ ${LOCALBASE}/bin/ftp <div> <div> <h2 class="title" style="clear: both"><a name= - "id2564993" id="id2564993"></a>6.10. What does + "id2584861" id="id2584861"></a>6.10. What does “<span class="quote">Don't know how to make /usr/share/tmac/tmac.andoc</span>” mean?</h2> </div> @@ -3980,22 +4023,21 @@ ${LOCALBASE}/bin/ftp <p>When compiling the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_install/README.html" - class="pkgname">pkgtools/pkg_install</a> package, you - get the error from make that it doesn't know how to - make <tt class= - "filename">/usr/share/tmac/tmac.andoc</tt>? This - indicates that you don't have installed the - “<span class="quote">text</span>” set on - your machine (nroff, ...). It is recommended to do - that to format manpages.</p> + class="pkgname">pkgtools/pkg_install</a> package, you get + the error from make that it doesn't know how to make + <code class="filename">/usr/share/tmac/tmac.andoc</code>? + This indicates that you don't have installed the + “<span class="quote">text</span>” set on your + machine (nroff, ...). It is recommended to do that to + format manpages.</p> <p>In the case of the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_install/README.html" - class="pkgname">pkgtools/pkg_install</a> package, you - can get away with setting <tt class= - "varname">NOMAN=YES</tt> either in the environment or - in <tt class="filename">/etc/mk.conf</tt>.</p> + class="pkgname">pkgtools/pkg_install</a> package, you can + get away with setting <code class= + "varname">NOMAN=YES</code> either in the environment or + in <code class="filename">/etc/mk.conf</code>.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -4003,27 +4045,28 @@ ${LOCALBASE}/bin/ftp <div> <div> <h2 class="title" style="clear: both"><a name= - "id2565031" id="id2565031"></a>6.11. What does + "id2584900" id="id2584900"></a>6.11. What does “<span class="quote">Could not find bsd.own.mk</span>” mean?</h2> </div> </div> </div> - <p>You didn't install the compiler set, <tt class= - "filename">comp.tgz</tt>, when you installed your NetBSD - machine. Please get it and install it, by extracting it - in <tt class="filename">/</tt>:</p> + <p>You didn't install the compiler set, <code class= + "filename">comp.tgz</code>, when you installed your + NetBSD machine. Please get it and install it, by + extracting it in <code class="filename">/</code>:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class="userinput"><tt>cd /</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>tar --unlink -zxvpf .../comp.tgz</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd /</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>tar --unlink -zxvpf .../comp.tgz</code></strong> </pre> - <p><tt class="filename">comp.tgz</tt> is part of every - NetBSD release. Get the one that corresponds to your - release (determine via <span><b class="command">uname - -r</b></span>).</p> + <p><code class="filename">comp.tgz</code> is part of + every NetBSD release. Get the one that corresponds to + your release (determine via <span><strong class= + "command">uname -r</strong></span>).</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -4031,7 +4074,7 @@ ${LOCALBASE}/bin/ftp <div> <div> <h2 class="title" style="clear: both"><a name= - "id2565089" id="id2565089"></a>6.12. Using + "id2584957" id="id2584957"></a>6.12. Using 'sudo' with pkgsrc</h2> </div> </div> @@ -4045,9 +4088,9 @@ ${LOCALBASE}/bin/ftp use it, install sudo (either as binary package or from <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/sudo/README.html" - class="pkgname">security/sudo</a>) and then put the - following into your <tt class= - "filename">/etc/mk.conf</tt>:</p> + class="pkgname">security/sudo</a>) and then put the + following into your <code class= + "filename">/etc/mk.conf</code>:</p> <pre class="programlisting"> .if exists(/usr/pkg/bin/sudo) SU_CMD=/usr/pkg/bin/sudo /bin/sh -c @@ -4068,73 +4111,74 @@ ${LOCALBASE}/bin/ftp </div> </div> - <p>The global variable <tt class= - "varname">PKG_SYSCONFBASE</tt> (and some others) can be - set by the system administrator in <tt class= - "filename">/etc/mk.conf</tt> to define the place where + <p>The global variable <code class= + "varname">PKG_SYSCONFBASE</code> (and some others) can be + set by the system administrator in <code class= + "filename">/etc/mk.conf</code> to define the place where configuration files get installed. Therefore, packages must be adapted to support this feature. Keep in mind that you should only install files that are strictly necessary in the configuration directory, files that can - go to <tt class="filename">$PREFIX/share</tt> should go - there.</p> + go to <code class="filename">$PREFIX/share</code> should + go there.</p> <p>We will take a look at available variables first - (<tt class="filename">bsd.pkg.mk</tt> contains more - information). <tt class="varname">PKG_SYSCONFDIR</tt> is - where the configuration files for a package may be found - (that is, the full path, e.g. <tt class= - "filename">/etc</tt> or <tt class= - "filename">/usr/pkg/etc</tt>). This value may be + (<code class="filename">bsd.pkg.mk</code> contains more + information). <code class="varname">PKG_SYSCONFDIR</code> + is where the configuration files for a package may be + found (that is, the full path, e.g. <code class= + "filename">/etc</code> or <code class= + "filename">/usr/pkg/etc</code>). This value may be customized in various ways:</p> <div class="orderedlist"> <ol type="1"> <li> - <p><tt class="varname">PKG_SYSCONFBASE</tt> is the - main config directory under which all package + <p><code class="varname">PKG_SYSCONFBASE</code> is + the main config directory under which all package configuration files are to be found. Users will - typically want to set it to <tt class= - "filename">/etc</tt>, or accept the default - location of <tt class= - "filename">$PREFIX/etc</tt>.</p> + typically want to set it to <code class= + "filename">/etc</code>, or accept the default + location of <code class= + "filename">$PREFIX/etc</code>.</p> </li> <li> - <p><tt class="varname">PKG_SYSCONFSUBDIR</tt> is - the subdirectory of <tt class= - "varname">PKG_SYSCONFBASE</tt> under which the + <p><code class="varname">PKG_SYSCONFSUBDIR</code> + is the subdirectory of <code class= + "varname">PKG_SYSCONFBASE</code> under which the configuration files for a particular package may be - found. Defaults to <tt class= - "varname">${SYSCONFBASE}</tt>.</p> + found. Defaults to <code class= + "varname">${SYSCONFBASE}</code>.</p> </li> <li> - <p><tt class="varname">PKG_SYSCONFVAR</tt> is the - special suffix used to distinguish any overriding - values for a particular package (see next item). It - defaults to <tt class="varname">${PKGBASE}</tt>, - but for a collection of related packages that - should all have the same <tt class= - "varname">PKG_SYSCONFDIR</tt> value, it can be set - in each of the package Makefiles to a common - value.</p> + <p><code class="varname">PKG_SYSCONFVAR</code> is + the special suffix used to distinguish any + overriding values for a particular package (see + next item). It defaults to <code class= + "varname">${PKGBASE}</code>, but for a collection + of related packages that should all have the same + <code class="varname">PKG_SYSCONFDIR</code> value, + it can be set in each of the package Makefiles to a + common value.</p> </li> <li> - <p><tt class= - "varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</tt> - overrides the value of <tt class= - "varname">${PKG_SYSCONFDIR}</tt> for packages with - the same value for <tt class= - "varname">PKG_SYSCONFVAR</tt>.</p> + <p><code class= + "varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code> + overrides the value of <code class= + "varname">${PKG_SYSCONFDIR}</code> for packages + with the same value for <code class= + "varname">PKG_SYSCONFVAR</code>.</p> <p>As an example, all the various KDE packages may - want to set <tt class="varname">PKG_SYSCONFVAR</tt> - to “<span class="quote">kde</span>” so - admins can set <tt class= - "varname">PKG_SYSCONFDIR.kde</tt> in <tt class= - "filename">/etc/mk.conf</tt> to define where to + want to set <code class= + "varname">PKG_SYSCONFVAR</code> to + “<span class="quote">kde</span>” so + admins can set <code class= + "varname">PKG_SYSCONFDIR.kde</code> in <code class= + "filename">/etc/mk.conf</code> to define where to install KDE config files.</p> </li> </ol> @@ -4148,28 +4192,30 @@ ${LOCALBASE}/bin/ftp now. When you change this pathname in packages, you should not allow them to install files in that directory directly. Instead they need to install those files under - <tt class="filename">share/examples/${PKGNAME}</tt> so - <tt class="filename">PLIST</tt> can register them.</p> + <code class="filename">share/examples/${PKGNAME}</code> + so <code class="filename">PLIST</code> can register + them.</p> <p>Once you have the required configuration files in - place (under the <tt class="filename">share/examples</tt> - directory) the variable <tt class= - "varname">CONF_FILES</tt> should be set to copy them into - <tt class="varname">PKG_SYSCONFDIR</tt>. The contents of - this variable is formed by pairs of filenames; the first + place (under the <code class= + "filename">share/examples</code> directory) the variable + <code class="varname">CONF_FILES</code> should be set to + copy them into <code class= + "varname">PKG_SYSCONFDIR</code>. The contents of this + variable is formed by pairs of filenames; the first element of the pair specifies the file inside the - examples directory (registered by <tt class= - "filename">PLIST</tt>) and the second element specifies + examples directory (registered by <code class= + "filename">PLIST</code>) and the second element specifies the target file. This is done this way to allow binary packages to place files in the right directory using - <tt class="filename">INSTALL</tt>/<tt class= - "filename">DEINSTALL</tt> scripts which are created - automatically. The package <tt class= - "filename">Makefile</tt> must also set <tt class= - "varname">USE_PKGINSTALL=YES</tt> to use these + <code class="filename">INSTALL</code>/<code class= + "filename">DEINSTALL</code> scripts which are created + automatically. The package <code class= + "filename">Makefile</code> must also set <code class= + "varname">USE_PKGINSTALL=YES</code> to use these automatically generated scripts. The automatic copying of config files can be toggled by setting the environment - variable <tt class="varname">PKG_CONFIG</tt> prior to + variable <code class="varname">PKG_CONFIG</code> prior to package installation.</p> <p>Here is an example, taken from mail/mutt/Makefile:</p> @@ -4179,12 +4225,13 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc </pre> <p>As you can see, this package installs configuration - files inside <tt class="varname">EGDIR</tt>, which are - registered by <tt class="filename">PLIST</tt>. After - that, the variable <tt class="varname">CONF_FILES</tt> - lists the installed file first and then the target file. - Users will also get an automatic message when files are - installed using this method.</p> + files inside <code class="varname">EGDIR</code>, which + are registered by <code class="filename">PLIST</code>. + After that, the variable <code class= + "varname">CONF_FILES</code> lists the installed file + first and then the target file. Users will also get an + automatic message when files are installed using this + method.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -4210,8 +4257,8 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc this, install the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/audit-packages/README.html" - class="pkgname">security/audit-packages</a> package. - It has two components:</p> + class="pkgname">security/audit-packages</a> package. It + has two components:</p> <div class="orderedlist"> <ol type="1"> @@ -4226,8 +4273,8 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <p><a href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/pkg-vulnerabilities" - target= - "_top">ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/pkg-vulnerabilities</a></p> + target= + "_top">ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/pkg-vulnerabilities</a></p> </li> <li> @@ -4299,26 +4346,28 @@ fi <dd> <dl> <dt><span class="sect1"><a href= - "#components.Makefile">7.1. Makefile</a></span></dt> + "#components.Makefile">7.1. <code class= + "filename">Makefile</code></a></span></dt> <dt><span class="sect1"><a href= - "#components.distinfo">7.2. distinfo</a></span></dt> + "#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="#id2566134">7.4. + <dt><span class="sect1"><a href="#id2586071">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="#id2566396">7.6. - work*</a></span></dt> + <dt><span class="sect1"><a href="#id2586197">7.6. + <code class="filename">work*</code></a></span></dt> - <dt><span class="sect1"><a href="#id2566484">7.7. - files/*</a></span></dt> + <dt><span class="sect1"><a href="#id2586284">7.7. + <code class="filename">files/*</code></a></span></dt> </dl> </dd> @@ -4327,25 +4376,28 @@ fi <dd> <dl> - <dt><span class="sect1"><a href="#id2566538">8.1. RCS + <dt><span class="sect1"><a href="#id2586339">8.1. RCS ID</a></span></dt> - <dt><span class="sect1"><a href="#id2566621">8.2. - Semi-automatic PLIST generation</a></span></dt> + <dt><span class="sect1"><a href="#id2586354">8.2. + Semi-automatic <code class="filename">PLIST</code> + generation</a></span></dt> <dt><span class="sect1"><a href="#print-PLIST">8.3. - Tweaking output of make print-PLIST</a></span></dt> + Tweaking output of <span><strong class="command">make + print-PLIST</strong></span></a></span></dt> <dt><span class="sect1"><a href="#plist.misc">8.4. Variable substitution in PLIST</a></span></dt> - <dt><span class="sect1"><a href="#id2566874">8.5. + <dt><span class="sect1"><a href="#id2586743">8.5. Manpage-compression</a></span></dt> - <dt><span class="sect1"><a href="#id2566916">8.6. - Changing PLIST source with PLIST_SRC</a></span></dt> + <dt><span class="sect1"><a href="#id2586785">8.6. + Changing PLIST source with <code class= + "varname">PLIST_SRC</code></a></span></dt> - <dt><span class="sect1"><a href="#id2566933">8.7. + <dt><span class="sect1"><a href="#id2586802">8.7. Platform specific and differing PLISTs</a></span></dt> @@ -4360,36 +4412,40 @@ fi <dd> <dl> - <dt><span class="sect1"><a href="#id2567137">9.1. + <dt><span class="sect1"><a href="#id2587074">9.1. Converting packages to use buildlink3</a></span></dt> - <dt><span class="sect1"><a href="#id2567532">9.2. - Writing buildlink3.mk files</a></span></dt> + <dt><span class="sect1"><a href="#id2587265">9.2. + Writing <code class="filename">buildlink3.mk</code> + files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2567670">9.2.1. Anatomy of a buildlink3.mk + "#id2587470">9.2.1. Anatomy of a buildlink3.mk file</a></span></dt> <dt><span class="sect2"><a href= - "#id2568110">9.2.2. Updating - BUILDLINK_DEPENDS.pkg in buildlink3.mk + "#id2588048">9.2.2. Updating <code class= + "varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code> in + <code class="filename">buildlink3.mk</code> files</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2568189">9.3. - Writing builtin.mk files</a></span></dt> + <dt><span class="sect1"><a href="#id2588126">9.3. + Writing <code class="filename">builtin.mk</code> + files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2568270">9.3.1. Anatomy of a builtin.mk - file</a></span></dt> + "#id2588208">9.3.1. Anatomy of a <code class= + "filename">builtin.mk</code> file</a></span></dt> <dt><span class="sect2"><a href= - "#id2568566">9.3.2. Global preferences for native + "#id2588366">9.3.2. Global preferences for native or pkgsrc software</a></span></dt> </dl> </dd> @@ -4401,12 +4457,12 @@ fi <dd> <dl> - <dt><span class="sect1"><a href="#id2568638">10.1. + <dt><span class="sect1"><a href="#id2588507">10.1. Global default options</a></span></dt> - <dt><span class="sect1"><a href="#id2568653">10.2. - Converting packages to use - bsd.options.mk</a></span></dt> + <dt><span class="sect1"><a href="#id2588522">10.2. + Converting packages to use <code class= + "filename">bsd.options.mk</code></a></span></dt> </dl> </dd> @@ -4418,7 +4474,7 @@ fi <dt><span class="sect1"><a href="#build.prefix">11.1. Program location</a></span></dt> - <dt><span class="sect1"><a href="#id2569330">11.2. + <dt><span class="sect1"><a href="#id2589198">11.2. Main targets</a></span></dt> <dt><span class="sect1"><a href= @@ -4432,17 +4488,17 @@ fi <dd> <dl> - <dt><span class="sect1"><a href="#id2570795">12.1. + <dt><span class="sect1"><a href="#id2590531">12.1. General operation</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2570798">12.1.1. How to pull in variables + "#id2590534">12.1.1. How to pull in variables from /etc/mk.conf</a></span></dt> <dt><span class="sect2"><a href= - "#id2570882">12.1.2. Restricted + "#id2590685">12.1.2. Restricted packages</a></span></dt> <dt><span class="sect2"><a href= @@ -4450,15 +4506,15 @@ fi dependencies</a></span></dt> <dt><span class="sect2"><a href= - "#id2571260">12.1.4. Handling conflicts with + "#id2591201">12.1.4. Handling conflicts with other packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2571447">12.1.5. Packages that cannot or + "#id2591251">12.1.5. Packages that cannot or should not be built</a></span></dt> <dt><span class="sect2"><a href= - "#id2571473">12.1.6. Packages which should not be + "#id2591413">12.1.6. Packages which should not be deleted, once installed</a></span></dt> <dt><span class="sect2"><a href= @@ -4466,37 +4522,37 @@ fi with security problems</a></span></dt> <dt><span class="sect2"><a href= - "#id2571564">12.1.8. How to handle compiler + "#id2591505">12.1.8. How to handle compiler bugs</a></span></dt> <dt><span class="sect2"><a href= - "#id2571587">12.1.9. How to handle incrementing + "#id2591527">12.1.9. How to handle incrementing versions when fixing an existing package</a></span></dt> <dt><span class="sect2"><a href= - "#id2571704">12.1.10. Portability of + "#id2591644">12.1.10. Portability of packages</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2571729">12.2. + <dt><span class="sect1"><a href="#id2591669">12.2. Possible downloading issues</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2571732">12.2.1. Packages whose distfiles + "#id2591672">12.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt> <dt><span class="sect2"><a href= - "#id2571795">12.2.2. How to handle modified + "#id2591735">12.2.2. How to handle modified distfiles with the 'old' name</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2571806">12.3. + <dt><span class="sect1"><a href="#id2591747">12.3. Configuration gotchas</a></span></dt> <dd> @@ -4506,65 +4562,65 @@ fi libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2572350">12.3.2. Using libtool on GNU + "#id2592086">12.3.2. Using libtool on GNU packages that already support libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2572435">12.3.3. GNU + "#id2592238">12.3.3. GNU Autoconf/Automake</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2572480">12.4. + <dt><span class="sect1"><a href="#id2592283">12.4. Building considerations</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2572483">12.4.1. CPP defines</a></span></dt> + "#id2592286">12.4.1. CPP defines</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2572513">12.5. + <dt><span class="sect1"><a href="#id2592316">12.5. Package specific actions</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2572516">12.5.1. Package configuration + "#id2592320">12.5.1. Package configuration files</a></span></dt> <dt><span class="sect2"><a href= - "#id2572618">12.5.2. User + "#id2592490">12.5.2. User interaction</a></span></dt> <dt><span class="sect2"><a href= - "#id2572663">12.5.3. Handling + "#id2592535">12.5.3. Handling licenses</a></span></dt> <dt><span class="sect2"><a href= - "#id2572746">12.5.4. Creating an account from a + "#id2592686">12.5.4. Creating an account from a package</a></span></dt> <dt><span class="sect2"><a href= - "#id2572876">12.5.5. Installing score + "#id2592748">12.5.5. Installing score files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573057">12.5.6. Packages providing login + "#id2592929">12.5.6. Packages providing login shells</a></span></dt> <dt><span class="sect2"><a href= - "#id2573182">12.5.7. Packages containing perl + "#id2593054">12.5.7. Packages containing perl scripts</a></span></dt> <dt><span class="sect2"><a href= - "#id2573201">12.5.8. Packages with hardcoded + "#id2593073">12.5.8. Packages with hardcoded paths to other interpreters</a></span></dt> <dt><span class="sect2"><a href= - "#id2573222">12.5.9. Packages installing perl + "#id2593094">12.5.9. Packages installing perl modules</a></span></dt> <dt><span class="sect2"><a href= @@ -4572,36 +4628,36 @@ fi info files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573442">12.5.11. Packages installing GConf2 + "#id2593450">12.5.11. Packages installing GConf2 data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573610">12.5.12. Packages installing + "#id2593550">12.5.12. Packages installing scrollkeeper data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573661">12.5.13. Packages installing X11 + "#id2593602">12.5.13. Packages installing X11 fonts</a></span></dt> <dt><span class="sect2"><a href= - "#id2573708">12.5.14. Packages installing GTK2 + "#id2593649">12.5.14. Packages installing GTK2 modules</a></span></dt> <dt><span class="sect2"><a href= - "#id2573778">12.5.15. Packages installing SGML or + "#id2593718">12.5.15. Packages installing SGML or XML data</a></span></dt> <dt><span class="sect2"><a href= - "#id2573830">12.5.16. Packages installing + "#id2593770">12.5.16. Packages installing extensions to the MIME database</a></span></dt> <dt><span class="sect2"><a href= - "#id2573969">12.5.17. Packages using + "#id2593841">12.5.17. Packages using intltool</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2573982">12.6. + <dt><span class="sect1"><a href="#id2593854">12.6. Feedback to the author</a></span></dt> </dl> </dd> @@ -4614,17 +4670,17 @@ fi <dd> <dl> - <dt><span class="sect1"><a href="#id2574444">14.1. + <dt><span class="sect1"><a href="#id2594385">14.1. Submitting your packages</a></span></dt> - <dt><span class="sect1"><a href="#id2574491">14.2. + <dt><span class="sect1"><a href="#id2594432">14.2. Committing: Importing a package into CVS</a></span></dt> - <dt><span class="sect1"><a href="#id2574691">14.3. + <dt><span class="sect1"><a href="#id2594563">14.3. Updating a package to a newer version</a></span></dt> - <dt><span class="sect1"><a href="#id2574710">14.4. + <dt><span class="sect1"><a href="#id2594582">14.4. Moving a package in pkgsrc</a></span></dt> </dl> </dd> @@ -4647,26 +4703,28 @@ fi <dl> <dt><span class="sect1"><a href= - "#components.Makefile">7.1. Makefile</a></span></dt> + "#components.Makefile">7.1. <code class= + "filename">Makefile</code></a></span></dt> <dt><span class="sect1"><a href= - "#components.distinfo">7.2. distinfo</a></span></dt> + "#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="#id2566134">7.4. Other + <dt><span class="sect1"><a href="#id2586071">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="#id2566396">7.6. - work*</a></span></dt> + <dt><span class="sect1"><a href="#id2586197">7.6. + <code class="filename">work*</code></a></span></dt> - <dt><span class="sect1"><a href="#id2566484">7.7. - files/*</a></span></dt> + <dt><span class="sect1"><a href="#id2586284">7.7. + <code class="filename">files/*</code></a></span></dt> </dl> </div> @@ -4680,41 +4738,41 @@ fi <div> <h2 class="title" style="clear: both"><a name= "components.Makefile" id= - "components.Makefile"></a>7.1. <tt class= - "filename">Makefile</tt></h2> + "components.Makefile"></a>7.1. <code class= + "filename">Makefile</code></h2> </div> </div> </div> <p>Building, installation and creation of a binary - package are all controlled by the package's <tt class= - "filename">Makefile</tt>.</p> - - <p>There is a <tt class="filename">Makefile</tt> for each - package. This file includes the standard <tt class= - "filename">bsd.pkg.mk</tt> file (referenced as <tt class= - "filename">../../mk/bsd.pkg.mk</tt>), which sets all the - definitions and actions necessary for the package to - compile and install itself. The mandatory variables are - the <tt class="varname">DISTNAME</tt> which specifies the - base name of the distribution file to be downloaded from - the site on the Internet, <tt class= - "varname">MASTER_SITES</tt> which specifies that site, - <tt class="varname">CATEGORIES</tt> which denotes the - categories into which the package falls, <tt class= - "varname">PKGNAME</tt> which is the name of the package, - the <tt class="varname">MAINTAINER</tt>'s name, and the - <tt class="varname">COMMENT</tt> variable, which should - contain a one-line description of the package (the - package name should not appear, it will be added - automatically). The maintainer variable is there so that - anyone who quibbles with the (always completely correct) - decisions taken by the guy who maintains the package can - complain vigorously, or send chocolate as a sign of - appreciation.</p> - - <p>The <tt class="varname">MASTER_SITES</tt> may be set - to one of the predefined sites:</p> + package are all controlled by the package's <code class= + "filename">Makefile</code>.</p> + + <p>There is a <code class="filename">Makefile</code> for + each package. This file includes the standard + <code class="filename">bsd.pkg.mk</code> file (referenced + as <code class="filename">../../mk/bsd.pkg.mk</code>), + which sets all the definitions and actions necessary for + the package to compile and install itself. The mandatory + variables are the <code class="varname">DISTNAME</code> + which specifies the base name of the distribution file to + be downloaded from the site on the Internet, <code class= + "varname">MASTER_SITES</code> which specifies that site, + <code class="varname">CATEGORIES</code> which denotes the + categories into which the package falls, <code class= + "varname">PKGNAME</code> which is the name of the + package, the <code class="varname">MAINTAINER</code>'s + name, and the <code class="varname">COMMENT</code> + variable, which should contain a one-line description of + the package (the package name should not appear, it will + be added automatically). The maintainer variable is there + so that anyone who quibbles with the (always completely + correct) decisions taken by the guy who maintains the + package can complain vigorously, or send chocolate as a + sign of appreciation.</p> + + <p>The <code class="varname">MASTER_SITES</code> may be + set to one of the predefined sites:</p> <pre class="programlisting"> ${MASTER_SITE_APACHE} ${MASTER_SITE_DEBIAN} @@ -4750,15 +4808,15 @@ fi "margin-left: 0.5in; margin-right: 0.5in;"> <h3 class="title">Note</h3> - <p><tt class="varname">MASTER_SITE_SUBDIR</tt> has been - deprecated and <span class="emphasis"><em>should no - longer be used</em></span>.</p> + <p><code class="varname">MASTER_SITE_SUBDIR</code> has + been deprecated and <span class="emphasis"><em>should + no longer be used</em></span>.</p> </div> - <p>If the package has multiple <tt class= - "varname">DISTFILES</tt> or multiple <tt class= - "varname">PATCHFILES</tt> from different sites, set - <tt class="varname">SITES_foo</tt> to a list of URI's + <p>If the package has multiple <code class= + "varname">DISTFILES</code> or multiple <code class= + "varname">PATCHFILES</code> from different sites, set + <code class="varname">SITES_foo</code> to a list of URI's where file “<span class="quote">foo</span>” may be found. “<span class= "quote">foo</span>” includes the suffix, e.g.</p> @@ -4769,14 +4827,14 @@ SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ http://www.somewhereelse.com/mirror/somehow/ </pre> - <p>Note that the normal default setting of <tt class= - "varname">DISTFILES</tt> must be made explicit if you + <p>Note that the normal default setting of <code class= + "varname">DISTFILES</code> must be made explicit if you want to add to it (rather than replace it), as you usually would.</p> <p>Currently the following values are available for - <tt class="varname">CATEGORIES</tt>. If more than one is - used, they need to be separated by spaces:</p> + <code class="varname">CATEGORIES</code>. If more than one + is used, they need to be separated by spaces:</p> <pre class="programlisting"> archivers cross geography meta-pkgs security audio databases graphics misc shells @@ -4793,14 +4851,14 @@ converters games mbone print x11 <div class="itemizedlist"> <ul type="disc"> <li> - <p>Add <tt class="varname">MANCOMPRESSED</tt> if - manpages are installed in compressed form by the - package; see comment in <tt class= - "filename">bsd.pkg.mk</tt>.</p> + <p>Add <code class="varname">MANCOMPRESSED</code> + if manpages are installed in compressed form by the + package; see comment in <code class= + "filename">bsd.pkg.mk</code>.</p> </li> <li> - <p>Replace <tt class="filename">/usr/local</tt> + <p>Replace <code class="filename">/usr/local</code> with “<span class= "quote">${PREFIX}</span>” in all files (see patches, below).</p> @@ -4815,24 +4873,24 @@ converters games mbone print x11 </li> <li> - <p>Set <tt class="varname">MAINTAINER</tt> to be - yourself. If you really can't maintain the package - for future updates, set it to <tt class= + <p>Set <code class="varname">MAINTAINER</code> to + be yourself. If you really can't maintain the + package for future updates, set it to <code class= "email"><<a href= - "mailto:tech-pkg@NetBSD.org">tech-pkg@NetBSD.org</a>></tt>.</p> + "mailto:tech-pkg@NetBSD.org">tech-pkg@NetBSD.org</a>></code>.</p> </li> <li> <p>If a home page for the software in question - exists, add the variable <tt class= - "varname">HOMEPAGE</tt> right after <tt class= - "varname">MAINTAINER</tt>. The value of this + exists, add the variable <code class= + "varname">HOMEPAGE</code> right after <code class= + "varname">MAINTAINER</code>. The value of this variable should be the URL for the home page.</p> </li> <li> - <p>Be sure to set the <tt class= - "varname">COMMENT</tt> variable to a short + <p>Be sure to set the <code class= + "varname">COMMENT</code> variable to a short description of the package, not containing the pkg's name.</p> </li> @@ -4846,8 +4904,8 @@ converters games mbone print x11 <div> <h2 class="title" style="clear: both"><a name= "components.distinfo" id= - "components.distinfo"></a>7.2. <tt class= - "filename">distinfo</tt></h2> + "components.distinfo"></a>7.2. <code class= + "filename">distinfo</code></h2> </div> </div> </div> @@ -4858,45 +4916,48 @@ converters games mbone print x11 distributed by the author. This ensures that the distfile retrieved from the Internet has not been corrupted during transfer or altered by a malign force to introduce a - security hole. It is generated using the <span><b class= - "command">make makesum</b></span> command. The digest - algorithm used was, at one stage, md5, but that was felt - lacking compared to sha1, and so sha1 is now the default + security hole. It is generated using the + <span><strong class="command">make + makesum</strong></span> command. The digest algorithm + used was, at one stage, md5, but that was felt lacking + compared to sha1, and so sha1 is now the default algorithm. The distfile size is also generated and stored in new distinfo files. The <a xmlns= "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> utility calculates - all of the digests in the distinfo file, and it - provides various different algorithms. At the current - time, the algorithms provided are: <span class= - "emphasis"><em>md5</em></span>, <span class= - "emphasis"><em>rmd160</em></span>, <span class= - "emphasis"><em>sha1</em></span>, <span class= - "emphasis"><em>sha256</em></span>, <span class= - "emphasis"><em>sha384</em></span> and <span class= - "emphasis"><em>sha512</em></span>.</p> + class="pkgname">pkgtools/digest</a> utility calculates + all of the digests in the distinfo file, and it provides + various different algorithms. At the current time, the + algorithms provided are: <span class= + "emphasis"><em>md5</em></span>, <span class= + "emphasis"><em>rmd160</em></span>, <span class= + "emphasis"><em>sha1</em></span>, <span class= + "emphasis"><em>sha256</em></span>, <span class= + "emphasis"><em>sha384</em></span> and <span class= + "emphasis"><em>sha512</em></span>.</p> <p>Some packages have different sets of distfiles on a per architecture basis, for example <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/navigator/README.html" - class="pkgname">www/navigator</a>). These are kept in - the same distinfo file and care should be taken when - upgrading such a package to ensure distfile - information is not lost.</p> + class="pkgname">www/navigator</a>). These are kept in the + same distinfo file and care should be taken when + upgrading such a package to ensure distfile information + is not lost.</p> <p>The message digest/checksum for all the official - patches found in the <tt class="filename">patches/</tt> - directory (see <a href="#components.patches" title= + patches found in the <code class= + "filename">patches/</code> directory (see <a href= + "#components.patches" title= "7.3. patches/*">Section 7.3, “patches/*”</a>) for the package is also - stored in the <tt class="filename">distinfo</tt> 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 <span><b class="command">make - makepatchsum</b></span> (or <span><b class="command">make - mps</b></span> if you're in a hurry).</p> + stored in the <code class="filename">distinfo</code> + 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 <span><strong class="command">make + makepatchsum</strong></span> (or <span><strong class= + "command">make mps</strong></span> if you're in a + hurry).</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -4920,14 +4981,15 @@ converters games mbone print x11 NetBSD. The files are applied successively in alphabetic order (as returned by a shell “<span class= "quote">patches/patch-*</span>” glob expansion), so - <tt class="filename">patch-aa</tt> is applied before - <tt class="filename">patch-ab</tt>, etc.</p> - - <p>The <tt class="filename">patch-*</tt> files should be - in <span><b class="command">diff -bu</b></span> format, - and apply without a fuzz to avoid problems. (To force - patches to apply with fuzz you can set <tt class= - "varname">PATCH_FUZZ_FACTOR=-F2</tt>). Furthermore, do + <code class="filename">patch-aa</code> is applied before + <code class="filename">patch-ab</code>, etc.</p> + + <p>The <code class="filename">patch-*</code> files should + be in <span><strong class="command">diff + -bu</strong></span> format, and apply without a fuzz to + avoid problems. (To force patches to apply with fuzz you + can set <code class= + "varname">PATCH_FUZZ_FACTOR=-F2</code>). Furthermore, do not put changes for more than one file into a single patch-file, as this will make future modifications more difficult.</p> @@ -4940,49 +5002,52 @@ converters games mbone print x11 <p>One important thing to mention is to pay attention that no RCS IDs get stored in the patch files, as these will cause problems when later checked into the NetBSD - CVS tree. Use the <span><b class= - "command">pkgdiff</b></span> from the <a xmlns= + CVS tree. Use the <span><strong class= + "command">pkgdiff</strong></span> from the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdiff/README.html" - class="pkgname">pkgtools/pkgdiff</a> package to avoid - these problems.</p> + class="pkgname">pkgtools/pkgdiff</a> package to avoid + these problems.</p> <p>For even more automation, we recommend using - <span><b class="command">mkpatches</b></span> from the - same package to make a whole set of patches. You just - have to backup files before you edit them to <tt class= - "filename">filename.orig</tt>, e.g. with <span><b class= - "command">cp -p filename filename.orig</b></span> or, - easier, by using <span><b class= - "command">pkgvi</b></span> again from the same package. - If you upgrade a package this way, you can easily compare - the new set of patches with the previously existing one - with <span><b class="command">patchdiff</b></span>.</p> + <span><strong class="command">mkpatches</strong></span> + from the same package to make a whole set of patches. You + just have to backup files before you edit them to + <code class="filename">filename.orig</code>, e.g. with + <span><strong class="command">cp -p filename + filename.orig</strong></span> or, easier, by using + <span><strong class="command">pkgvi</strong></span> again + from the same package. If you upgrade a package this way, + you can easily compare the new set of patches with the + previously existing one with <span><strong class= + "command">patchdiff</strong></span>.</p> <p>When you have finished a package, remember to generate the checksums for the patch files by using the - <span><b class="command">make makepatchsum</b></span> - command, see <a href="#components.distinfo" title= + <span><strong class="command">make + makepatchsum</strong></span> command, see <a href= + "#components.distinfo" title= "7.2. distinfo">Section 7.2, - “distinfo”</a>.</p> + “<code class="filename">distinfo</code>”</a>.</p> <p>Patch files that are distributed by the author or - other maintainers can be listed in <tt class= - "varname">$PATCHFILES</tt>.</p> + other maintainers can be listed in <code class= + "varname">$PATCHFILES</code>.</p> <p>If it is desired to store any patches that should not be committed into pkgsrc, they can be kept outside the - pkgsrc tree in the <tt class= - "filename">$LOCALPATCHES</tt> directory. The directory + pkgsrc tree in the <code class= + "filename">$LOCALPATCHES</code> directory. The directory tree there is expected to have the same “<span class="quote">category/package</span>” structure as pkgsrc, and patches are expected to be - stored inside these dirs (also known as <tt class= - "filename">$LOCALPATCHES/$PKGPATH</tt>). For example if - you want to keep a private patch for <tt class= - "filename">pkgsrc/graphics/png</tt>, keep it in - <tt class="filename">$LOCALPATCHES/graphics/png/mypatch</tt>. - All files in the named directory are expected to be patch + stored inside these dirs (also known as <code class= + "filename">$LOCALPATCHES/$PKGPATH</code>). For example if + you want to keep a private patch for <code class= + "filename">pkgsrc/graphics/png</code>, keep it in + <code class= + "filename">$LOCALPATCHES/graphics/png/mypatch</code>. All + files in the named directory are expected to be patch files, and <span class="emphasis"><em>they are applied after pkgsrc patches are applied</em></span>.</p> </div> @@ -4992,7 +5057,7 @@ converters games mbone print x11 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2566134" id="id2566134"></a>7.4. Other + "id2586071" id="id2586071"></a>7.4. Other mandatory files</h2> </div> </div> @@ -5000,8 +5065,8 @@ converters games mbone print x11 <div class="variablelist"> <dl> - <dt><span class="term"><tt class= - "filename">DESCR</tt></span></dt> + <dt><span class="term"><code class= + "filename">DESCR</code></span></dt> <dd> <p>A multi-line description of the piece of @@ -5012,8 +5077,8 @@ converters games mbone print x11 everything that you write here.</p> </dd> - <dt><span class="term"><tt class= - "filename">PLIST</tt></span></dt> + <dt><span class="term"><code class= + "filename">PLIST</code></span></dt> <dd> <p>This file governs the files that are installed @@ -5043,8 +5108,8 @@ converters games mbone print x11 <div class="variablelist"> <dl> - <dt><span class="term"><tt class= - "filename">INSTALL</tt></span></dt> + <dt><span class="term"><code class= + "filename">INSTALL</code></span></dt> <dd> <p>This shell script is invoked twice by <a href= @@ -5055,8 +5120,8 @@ converters games mbone print x11 moved in place, the second time after the files to install are moved in place. This can be used to do any custom procedures not possible with @exec - commands in <tt class="filename">PLIST</tt>. See - <a href= + commands in <code class="filename">PLIST</code>. + See <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">pkg_add</span>(1)</span></a> and @@ -5067,8 +5132,8 @@ converters games mbone print x11 more information.</p> </dd> - <dt><span class="term"><tt class= - "filename">DEINSTALL</tt></span></dt> + <dt><span class="term"><code class= + "filename">DEINSTALL</code></span></dt> <dd> <p>This script is executed before and after any @@ -5087,8 +5152,8 @@ converters games mbone print x11 more information.</p> </dd> - <dt><span class="term"><tt class= - "filename">MESSAGE</tt></span></dt> + <dt><span class="term"><code class= + "filename">MESSAGE</code></span></dt> <dd> <p>Display this file after installation of the @@ -5096,16 +5161,16 @@ converters games mbone print x11 almost-free software and hints for updating config files after installing modules for apache, PHP etc. Please note that you can modify variables in it - easily by using <tt class= - "varname">MESSAGE_SUBST</tt> in the package's - <tt class="filename">Makefile</tt>:</p> + easily by using <code class= + "varname">MESSAGE_SUBST</code> in the package's + <code class="filename">Makefile</code>:</p> <pre class="programlisting"> MESSAGE_SUBST+= SOMEVAR="somevalue" </pre> <p>replaces "${SOMEVAR}" with “<span class= - "quote">somevalue</span>” in <tt class= - "filename">MESSAGE</tt>.</p> + "quote">somevalue</span>” in <code class= + "filename">MESSAGE</code>.</p> </dd> </dl> </div> @@ -5116,57 +5181,60 @@ MESSAGE_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "id2566396" id="id2566396"></a>7.6. <tt class= - "filename">work*</tt></h2> + "id2586197" id= + "id2586197"></a>7.6. <code class= + "filename">work*</code></h2> </div> </div> </div> - <p>When you type <span><b class="command">make</b></span> - the distribution files are unpacked into this directory. - It can be removed by running <span><b class= - "command">make clean</b></span>. Besides the sources, - this directory is also used to keep various timestamp + <p>When you type <span><strong class= + "command">make</strong></span> the distribution files are + unpacked into this directory. It can be removed by + running <span><strong class="command">make + clean</strong></span>. Besides the sources, this + directory is also used to keep various timestamp files.</p> <p>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 - <tt class="varname">WRKSRC</tt> accordingly, e.g. + <code class="varname">WRKSRC</code> accordingly, e.g. <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/editors/sam/README.html" - class="pkgname">editors/sam</a> again, but the quick - answer is:</p> + class="pkgname">editors/sam</a> again, but the quick + answer is:</p> <pre class="programlisting"> WRKSRC= ${WRKDIR} </pre> - <p>Please note that the old <tt class= - "varname">NO_WRKSUBDIR</tt> has been deprecated and + <p>Please note that the old <code class= + "varname">NO_WRKSUBDIR</code> has been deprecated and should not be used. Also, if your package doesn't create - a subdir with the name of <tt class= - "varname">DISTNAME</tt> but some different name, set - <tt class="varname">WRKSRC</tt> to point to the proper - name in <tt class="filename">${WRKDIR}</tt>. See - <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= + a subdir with the name of <code class= + "varname">DISTNAME</code> but some different name, set + <code class="varname">WRKSRC</code> to point to the + proper name in <code class="filename">${WRKDIR}</code>. + See <a xmlns="http://www.w3.org/TR/xhtml1/transitional" + href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/lang/tcl/README.html" - class="pkgname">lang/tcl</a> and <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/tk/README.html" - class="pkgname">x11/tk</a> for examples, and here is - another one:</p> + class="pkgname">lang/tcl</a> and <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/tk/README.html" + class="pkgname">x11/tk</a> for examples, and here is + another one:</p> <pre class="programlisting"> WRKSRC= ${WRKDIR}/${DISTNAME}/unix </pre> <p>The name of the working directory created by pkgsrc is - <tt class="filename">work</tt> by default. If the same - pkgsrc tree should be used on several different - platforms, the variable <tt class= - "varname">OBJMACHINE</tt> can be set in /etc/mk.conf to + <code class="filename">work</code> by default. If the + same pkgsrc tree should be used on several different + platforms, the variable <code class= + "varname">OBJMACHINE</code> can be set in /etc/mk.conf to attach the platform to the directory name, e.g. - <tt class="filename">work.i386</tt> or <tt class= - "filename">work.sparc</tt>.</p> + <code class="filename">work.i386</code> or <code class= + "filename">work.sparc</code>.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -5174,8 +5242,9 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <div> <div> <h2 class="title" style="clear: both"><a name= - "id2566484" id="id2566484"></a>7.7. <tt class= - "filename">files/*</tt></h2> + "id2586284" id= + "id2586284"></a>7.7. <code class= + "filename">files/*</code></h2> </div> </div> </div> @@ -5186,9 +5255,9 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix "quote">${CP}</span>” command in the “<span class="quote">pre-configure</span>” target to achieve this. Alternatively, you could simply - diff the file against <tt class="filename">/dev/null</tt> - and use the patch mechanism to manage the creation of - this file.</p> + diff the file against <code class= + "filename">/dev/null</code> and use the patch mechanism + to manage the creation of this file.</p> </div> </div> @@ -5206,25 +5275,28 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2566538">8.1. RCS + <dt><span class="sect1"><a href="#id2586339">8.1. RCS ID</a></span></dt> - <dt><span class="sect1"><a href="#id2566621">8.2. - Semi-automatic PLIST generation</a></span></dt> + <dt><span class="sect1"><a href="#id2586354">8.2. + Semi-automatic <code class="filename">PLIST</code> + generation</a></span></dt> <dt><span class="sect1"><a href="#print-PLIST">8.3. - Tweaking output of make print-PLIST</a></span></dt> + Tweaking output of <span><strong class="command">make + print-PLIST</strong></span></a></span></dt> <dt><span class="sect1"><a href="#plist.misc">8.4. Variable substitution in PLIST</a></span></dt> - <dt><span class="sect1"><a href="#id2566874">8.5. + <dt><span class="sect1"><a href="#id2586743">8.5. Manpage-compression</a></span></dt> - <dt><span class="sect1"><a href="#id2566916">8.6. - Changing PLIST source with PLIST_SRC</a></span></dt> + <dt><span class="sect1"><a href="#id2586785">8.6. + Changing PLIST source with <code class= + "varname">PLIST_SRC</code></a></span></dt> - <dt><span class="sect1"><a href="#id2566933">8.7. + <dt><span class="sect1"><a href="#id2586802">8.7. Platform specific and differing PLISTs</a></span></dt> <dt><span class="sect1"><a href="#faq.common-dirs">8.8. @@ -5232,32 +5304,32 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix </dl> </div> - <p>The <tt class="filename">PLIST</tt> file contains a + <p>The <code class="filename">PLIST</code> file contains a package's “<span class="quote">packing list</span>”, i.e. a list of files that belong to the - package (relative to the <tt class= - "filename">${PREFIX}</tt> directory it's been installed in) - plus some additional statements - see the <a href= + package (relative to the <code class= + "filename">${PREFIX}</code> directory it's been installed + in) plus some additional statements - see the <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_create+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">pkg_create</span>(1)</span></a> manpage for a full list. This chapter addresses some issues that need - attention when dealing with the <tt class= - "filename">PLIST</tt> file (or files, see below!).</p> + attention when dealing with the <code class= + "filename">PLIST</code> file (or files, see below!).</p> <div class="sect1" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2566538" id="id2566538"></a>8.1. RCS + "id2586339" id="id2586339"></a>8.1. RCS ID</h2> </div> </div> </div> <p>Be sure to add a RCS ID line as the first thing in any - <tt class="filename">PLIST</tt> file you write:</p> + <code class="filename">PLIST</code> file you write:</p> <pre class="programlisting"> @comment $NetBSD$ </pre> @@ -5268,17 +5340,17 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <div> <div> <h2 class="title" style="clear: both"><a name= - "id2566621" id= - "id2566621"></a>8.2. Semi-automatic <tt class= - "filename">PLIST</tt> generation</h2> + "id2586354" id= + "id2586354"></a>8.2. Semi-automatic + <code class="filename">PLIST</code> generation</h2> </div> </div> </div> - <p>You can use the <span><b class="command">make - print-PLIST</b></span> command to output a PLIST that - matches any new files since the package was extracted. - See <a href="#build.helpful-targets" title= + <p>You can use the <span><strong class="command">make + print-PLIST</strong></span> command to output a PLIST + that matches any new files since the package was + extracted. See <a href="#build.helpful-targets" title= "11.3. Other helpful targets">Section 11.3, “Other helpful targets”</a> for more information on this target.</p> @@ -5291,8 +5363,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <h2 class="title" style="clear: both"><a name= "print-PLIST" id= "print-PLIST"></a>8.3. Tweaking output of - <span><b class="command">make - print-PLIST</b></span></h2> + <span><strong class="command">make + print-PLIST</strong></span></h2> </div> </div> </div> @@ -5301,33 +5373,33 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix explained in <a href="#faq.common-dirs" title= "8.8. Sharing directories between packages">Section 8.8, “Sharing directories between packages”</a>, - you may have noticed that <span><b class="command">make - print-PLIST</b></span> outputs a set of <tt class= - "varname">@comment</tt>s instead of real <tt class= - "varname">@dirrm</tt> lines. You can also do this for - specific directories and files, so that the results of - that command are very close to reality. This helps - <span class="emphasis"><em>a lot</em></span> during the - update of packages.</p> - - <p>The <tt class="varname">PRINT_PLIST_AWK</tt> variable - takes a set of AWK patterns and actions that are used to - filter the output of print-PLIST. You can <span class= - "emphasis"><em>append</em></span> any chunk of AWK - scripting you like to it, but be careful with + you may have noticed that <span><strong class= + "command">make print-PLIST</strong></span> outputs a set + of <code class="varname">@comment</code>s instead of real + <code class="varname">@dirrm</code> lines. You can also + do this for specific directories and files, so that the + results of that command are very close to reality. This + helps <span class="emphasis"><em>a lot</em></span> during + the update of packages.</p> + + <p>The <code class="varname">PRINT_PLIST_AWK</code> + variable takes a set of AWK patterns and actions that are + used to filter the output of print-PLIST. You can + <span class="emphasis"><em>append</em></span> any chunk + of AWK scripting you like to it, but be careful with quoting.</p> - <p>For example, to get all files inside the <tt class= - "filename">libdata/foo</tt> directory removed from the + <p>For example, to get all files inside the <code class= + "filename">libdata/foo</code> directory removed from the resulting PLIST:</p> <pre class="programlisting"> PRINT_PLIST_AWK+= /^libdata\/foo/ { next; } </pre> - <p>And to get all the <tt class="varname">@dirrm</tt> + <p>And to get all the <code class="varname">@dirrm</code> lines referring to a specific (shared) directory - converted to <tt class="varname">@comment</tt>s:</p> + converted to <code class="varname">@comment</code>s:</p> <pre class="programlisting"> PRINT_PLIST_AWK+= /^@dirrm share\/specific/ { print "@comment " $$0; next; } @@ -5351,9 +5423,9 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <div class="variablelist"> <dl> - <dt><span class="term"><tt class= - "varname">${MACHINE_ARCH}</tt>, <tt class= - "varname">${MACHINE_GNU_ARCH}</tt></span></dt> + <dt><span class="term"><code class= + "varname">${MACHINE_ARCH}</code>, <code class= + "varname">${MACHINE_GNU_ARCH}</code></span></dt> <dd> <p>Some packages like emacs and perl embed @@ -5361,66 +5433,67 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix built on into the pathnames where they install their file. To handle this case, PLIST will be preprocessed before actually used, and the symbol - “<span class="quote"><tt class= - "varname">${MACHINE_ARCH}</tt></span>” will - be replaced by what <span><b class="command">uname - -p</b></span> gives. The same is done if the string - <tt class="varname">${MACHINE_GNU_ARCH}</tt> is - embedded in PLIST somewhere - use this on packages - that have GNU autoconf created configure - scripts.</p> + “<span class="quote"><code class= + "varname">${MACHINE_ARCH}</code></span>” will + be replaced by what <span><strong class= + "command">uname -p</strong></span> gives. The same + is done if the string <code class= + "varname">${MACHINE_GNU_ARCH}</code> is embedded in + PLIST somewhere - use this on packages that have + GNU autoconf created configure scripts.</p> <div class="note" style= "margin-left: 0.5in; margin-right: 0.5in;"> <h3 class="title">Legacy note</h3> <p>There used to be a symbol “<span class= - "quote"><tt class= - "varname">$ARCH</tt></span>” that was - replaced by the output of <span><b class= - "command">uname -m</b></span>, but that's no + "quote"><code class= + "varname">$ARCH</code></span>” that was + replaced by the output of <span><strong class= + "command">uname -m</strong></span>, but that's no longer supported and has been removed.</p> </div> </dd> - <dt><span class="term"><tt class= - "varname">${OPSYS}</tt>, <tt class= - "varname">${LOWER_OPSYS}</tt>, <tt class= - "varname">${OS_VERSION}</tt></span></dt> + <dt><span class="term"><code class= + "varname">${OPSYS}</code>, <code class= + "varname">${LOWER_OPSYS}</code>, <code class= + "varname">${OS_VERSION}</code></span></dt> <dd> <p>Some packages want to embed the OS name and version into some paths. To do this, use these - variables in the <tt class= - "filename">PLIST</tt>:</p> + variables in the <code class= + "filename">PLIST</code>:</p> <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class="varname">${OPSYS}</tt> - output - of “<span class="quote"><span><b class= - "command">uname - -s</b></span></span>”</p> + <p><code class="varname">${OPSYS}</code> - + output of “<span class= + "quote"><span><strong class="command">uname + -s</strong></span></span>”</p> </li> <li> - <p><tt class="varname">${LOWER_OPSYS}</tt> - - lowercase common name (eg. - “<span class="quote">solaris</span>”)</p> + <p><code class= + "varname">${LOWER_OPSYS}</code> - lowercase + common name (eg. “<span class= + "quote">solaris</span>”)</p> </li> <li> - <p><tt class="varname">${OS_VERSION}</tt> - - “<span class="quote"><span><b class= - "command">uname - -r</b></span></span>”</p> + <p><code class="varname">${OS_VERSION}</code> + - “<span class= + "quote"><span><strong class="command">uname + -r</strong></span></span>”</p> </li> </ul> </div> </dd> - <dt><span class="term"><tt class= - "varname">${PKGLOCALEDIR}</tt></span></dt> + <dt><span class="term"><code class= + "varname">${PKGLOCALEDIR}</code></span></dt> <dd> <p>Packages that install locale files should list @@ -5430,21 +5503,21 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix "quote">share/locale/de/LC_MESSAGES/...</span>”. This properly handles the fact that different operating systems expect locale files to be either - in <tt class="filename">share</tt> or <tt class= - "filename">lib</tt> by default.</p> + in <code class="filename">share</code> or + <code class="filename">lib</code> by default.</p> </dd> </dl> </div> <p>For a complete list of values which are replaced by - default, please look in <tt class= - "filename">bsd.pkg.mk</tt> (and search for <span class= + default, please look in <code class= + "filename">bsd.pkg.mk</code> (and search for <span class= "emphasis"><em>PLIST_SUBST</em></span>).</p> <p>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 <tt class= - "varname">MESSAGE_SUBST</tt> (see <a href= + variable in the following way, similar to <code class= + "varname">MESSAGE_SUBST</code> (see <a href= "#components.optional" title= "7.5. Optional files">Section 7.5, “Optional files”</a>):</p> @@ -5462,24 +5535,24 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "id2566874" id= - "id2566874"></a>8.5. Manpage-compression</h2> + "id2586743" id= + "id2586743"></a>8.5. Manpage-compression</h2> </div> </div> </div> <p>Manpages should be installed in compressed form if - <tt class="varname">MANZ</tt> is set (in <tt class= - "filename">bsd.own.mk</tt>), and uncompressed otherwise. - To handle this in the <tt class="filename">PLIST</tt> - file, the suffix “<span class= - "quote">.gz</span>” is appended/removed - automatically for manpages according to <tt class= - "varname">MANZ</tt> and <tt class= - "varname">MANCOMPRESSED</tt> being set or not, see above - for details. This modification of the <tt class= - "filename">PLIST</tt> file is done on a copy of it, not - <tt class="filename">PLIST</tt> itself.</p> + <code class="varname">MANZ</code> is set (in <code class= + "filename">bsd.own.mk</code>), and uncompressed + otherwise. To handle this in the <code class= + "filename">PLIST</code> file, the suffix + “<span class="quote">.gz</span>” is + appended/removed automatically for manpages according to + <code class="varname">MANZ</code> and <code class= + "varname">MANCOMPRESSED</code> being set or not, see + above for details. This modification of the <code class= + "filename">PLIST</code> file is done on a copy of it, not + <code class="filename">PLIST</code> itself.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -5487,17 +5560,17 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "id2566916" id="id2566916"></a>8.6. Changing - PLIST source with <tt class= - "varname">PLIST_SRC</tt></h2> + "id2586785" id="id2586785"></a>8.6. Changing + PLIST source with <code class= + "varname">PLIST_SRC</code></h2> </div> </div> </div> - <p>To use one or more files as source for the <tt class= - "filename">PLIST</tt> used in generating the binary - package, set the variable <tt class= - "varname">PLIST_SRC</tt> to the names of that file(s). + <p>To use one or more files as source for the + <code class="filename">PLIST</code> used in generating + the binary package, set the variable <code class= + "varname">PLIST_SRC</code> to the names of that file(s). The files are later concatenated using cat(1), and order of things is important.</p> </div> @@ -5507,7 +5580,7 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "id2566933" id="id2566933"></a>8.7. Platform + "id2586802" id="id2586802"></a>8.7. Platform specific and differing PLISTs</h2> </div> </div> @@ -5521,25 +5594,26 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class="filename">PLIST.common</tt></p> + <p><code class="filename">PLIST.common</code></p> </li> <li> - <p><tt class="filename">PLIST.${OPSYS}</tt></p> + <p><code class="filename">PLIST.${OPSYS}</code></p> </li> <li> - <p><tt class="filename">PLIST.common_end</tt></p> + <p><code class= + "filename">PLIST.common_end</code></p> </li> </ul> </div> - <p>If <tt class="filename">PLIST.${OPSYS}</tt> exists, - these files are used instead of <tt class= - "filename">PLIST</tt>. This allows packages which behave - in this way to be handled gracefully. Manually overriding - <tt class="varname">PLIST_SRC</tt> for other more exotic - uses is also possible.</p> + <p>If <code class="filename">PLIST.${OPSYS}</code> + exists, these files are used instead of <code class= + "filename">PLIST</code>. This allows packages which + behave in this way to be handled gracefully. Manually + overriding <code class="varname">PLIST_SRC</code> for + other more exotic uses is also possible.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -5584,9 +5658,9 @@ PLIST_SUBST+= SOMEVAR="somevalue" <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/textproc/scrollkeeper/README.html" - class="pkgname">textproc/scrollkeeper</a>, which - removes the shared directory <tt class= - "filename">share/omf</tt>.</p> + class="pkgname">textproc/scrollkeeper</a>, which + removes the shared directory <code class= + "filename">share/omf</code>.</p> </li> <li> @@ -5600,35 +5674,36 @@ PLIST_SUBST+= SOMEVAR="somevalue" <p>From now on, we'll discuss the second solution. To get an idea of the *-dirs packages available, issue:</p> <pre class="programlisting"> - <tt class="prompt">%</tt> cd .../pkgsrc - <tt class="prompt">%</tt> ls -d */*-dirs + <code class="prompt">%</code> cd .../pkgsrc + <code class="prompt">%</code> ls -d */*-dirs </pre> <p>Their use from other packages is very simple. The - <tt class="varname">USE_DIRS</tt> variable takes a list - of package names (without the “<span class= + <code class="varname">USE_DIRS</code> variable takes a + list of package names (without the “<span class= "quote">-dirs</span>” part) together with the required version number (always pick the latest one when writting new packages).</p> <p>For example, if a package installs files under - <tt class="filename">share/applications</tt>, it should - have the following line in it:</p> + <code class="filename">share/applications</code>, it + should have the following line in it:</p> <pre class="programlisting"> USE_DIRS+= xdg-1.1 </pre> - <p>After regenerating the PLIST using <span><b class= - "command">make print-PLIST</b></span>, you should get the - right (commented out) lines.</p> + <p>After regenerating the PLIST using + <span><strong class="command">make + print-PLIST</strong></span>, you should get the right + (commented out) lines.</p> - <p>Note that, even if your package is using <tt class= - "filename">$X11BASE</tt>, it must not depend on the + <p>Note that, even if your package is using <code class= + "filename">$X11BASE</code>, it must not depend on the *-x11-dirs packages. Just specify the name without that - part and pkgsrc (in particular, <tt class= - "filename">mk/dirs.mk</tt>) will take care of it.</p> + part and pkgsrc (in particular, <code class= + "filename">mk/dirs.mk</code>) will take care of it.</p> </div> </div> @@ -5647,32 +5722,38 @@ PLIST_SUBST+= SOMEVAR="somevalue" <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2567137">9.1. + <dt><span class="sect1"><a href="#id2587074">9.1. Converting packages to use buildlink3</a></span></dt> - <dt><span class="sect1"><a href="#id2567532">9.2. - Writing buildlink3.mk files</a></span></dt> + <dt><span class="sect1"><a href="#id2587265">9.2. + Writing <code class="filename">buildlink3.mk</code> + files</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2567670">9.2.1. + <dt><span class="sect2"><a href="#id2587470">9.2.1. Anatomy of a buildlink3.mk file</a></span></dt> - <dt><span class="sect2"><a href="#id2568110">9.2.2. - Updating BUILDLINK_DEPENDS.pkg in buildlink3.mk + <dt><span class="sect2"><a href="#id2588048">9.2.2. + Updating <code class= + "varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code> in + <code class="filename">buildlink3.mk</code> files</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2568189">9.3. - Writing builtin.mk files</a></span></dt> + <dt><span class="sect1"><a href="#id2588126">9.3. + Writing <code class="filename">builtin.mk</code> + files</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2568270">9.3.1. - Anatomy of a builtin.mk file</a></span></dt> + <dt><span class="sect2"><a href="#id2588208">9.3.1. + Anatomy of a <code class= + "filename">builtin.mk</code> file</a></span></dt> - <dt><span class="sect2"><a href="#id2568566">9.3.2. + <dt><span class="sect2"><a href="#id2588366">9.3.2. Global preferences for native or pkgsrc software</a></span></dt> </dl> @@ -5689,21 +5770,22 @@ PLIST_SUBST+= SOMEVAR="somevalue" <ol type="1"> <li> <p>Symlink headers and libraries for dependencies - into <tt class="varname">BUILDLINK_DIR</tt>, which by - default is a subdirectory of <tt class= - "varname">WRKDIR</tt>.</p> + into <code class="varname">BUILDLINK_DIR</code>, + which by default is a subdirectory of <code class= + "varname">WRKDIR</code>.</p> </li> <li> <p>Create wrapper scripts that are used in place of - the normal compiler tools that translate <tt class= - "option">-I${LOCALBASE}/include</tt> and <tt class= - "option">-L${LOCALBASE}/lib</tt> into references to - <tt class="varname">BUILDLINK_DIR</tt>. The wrapper - scripts also make native compiler on some operating - systems look like GCC, so that packages that expect - GCC won't require modifications to build with those - native compilers.</p> + the normal compiler tools that translate <code class= + "option">-I${LOCALBASE}/include</code> and + <code class="option">-L${LOCALBASE}/lib</code> into + references to <code class= + "varname">BUILDLINK_DIR</code>. The wrapper scripts + also make native compiler on some operating systems + look like GCC, so that packages that expect GCC won't + require modifications to build with those native + compilers.</p> </li> </ol> </div> @@ -5711,9 +5793,9 @@ PLIST_SUBST+= SOMEVAR="somevalue" <p>This normalizes the environment in which a package is built so that the package may be built consistently despite what other software may be installed. Please note that the - normal system header and library paths, e.g. <tt class= - "filename">/usr/include</tt>, <tt class= - "filename">/usr/lib</tt>, etc., are always searched -- + normal system header and library paths, e.g. <code class= + "filename">/usr/include</code>, <code class= + "filename">/usr/lib</code>, etc., are always searched -- buildlink3 is designed to insulate the package build from non-system-supplied software.</p> @@ -5722,7 +5804,7 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "id2567137" id="id2567137"></a>9.1. Converting + "id2587074" id="id2587074"></a>9.1. Converting packages to use buildlink3</h2> </div> </div> @@ -5736,34 +5818,35 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div class="orderedlist"> <ol type="1"> <li> - <p>Set <tt class="varname">USE_BUILDLINK3</tt> to - “<span class="quote">yes</span>”.</p> + <p>Set <code class="varname">USE_BUILDLINK3</code> + to “<span class= + "quote">yes</span>”.</p> </li> <li> <p>Ensure that the build always calls the wrapper scripts instead of the actual toolchain. Some packages are tricky, and the only way to know for - sure is the check <tt class= - "filename">${WRKDIR}/.work.log</tt> to see if the + sure is the check <code class= + "filename">${WRKDIR}/.work.log</code> to see if the wrappers are being invoked.</p> </li> <li> - <p>Don't override <tt class="varname">PREFIX</tt> - from within the package Makefile, e.g. Java VMs, - standalone shells, etc., because the code to - symlink files into <tt class= - "filename">${BUILDLINK_DIR}</tt> looks for files + <p>Don't override <code class= + "varname">PREFIX</code> from within the package + Makefile, e.g. Java VMs, standalone shells, etc., + because the code to symlink files into <code class= + "filename">${BUILDLINK_DIR}</code> looks for files relative to “<span class="quote">pkg_info -qp - <i class= - "replaceable"><tt>pkgname</tt></i></span>”.</p> + <em class= + "replaceable"><code>pkgname</code></em></span>”.</p> </li> <li> <p>Remember that <span class= - "emphasis"><em>only</em></span> the <tt class= - "filename">buildlink3.mk</tt> files that you list + "emphasis"><em>only</em></span> the <code class= + "filename">buildlink3.mk</code> files that you list in a package's Makefile are added as dependencies for that package.</p> </li> @@ -5781,86 +5864,89 @@ DEPENDS+= foo>=1.1.0:../../category/foo .include "../../category/foo/buildlink3.mk" </pre> - <p>There are several <tt class= - "filename">buildlink3.mk</tt> files in <tt class= - "filename">pkgsrc/mk</tt> that handle special package + <p>There are several <code class= + "filename">buildlink3.mk</code> files in <code class= + "filename">pkgsrc/mk</code> that handle special package issues:</p> <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class="filename">bdb.buildlink3.mk</tt> + <p><code class="filename">bdb.buildlink3.mk</code> chooses either the native or a pkgsrc Berkeley DB - implementation based on the values of <tt class= - "varname">BDB_ACCEPTED</tt> and <tt class= - "varname">BDB_DEFAULT</tt>.</p> + implementation based on the values of <code class= + "varname">BDB_ACCEPTED</code> and <code class= + "varname">BDB_DEFAULT</code>.</p> </li> <li> - <p><tt class="filename">curses.buildlink3.mk</tt> - If the system comes with neither Curses nor - NCurses, this will take care to install the - <a xmlns="http://www.w3.org/TR/xhtml1/transitional" - href= + <p><code class= + "filename">curses.buildlink3.mk</code> If the + system comes with neither Curses nor NCurses, this + will take care to install the <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/ncurses/README.html" - class="pkgname">devel/ncurses</a> package.</p> + class="pkgname">devel/ncurses</a> package.</p> </li> <li> - <p><tt class="filename">krb5.buildlink3.mk</tt> - uses the value of <tt class= - "varname">KRB5_ACCEPTED</tt> to choose between + <p><code class="filename">krb5.buildlink3.mk</code> + uses the value of <code class= + "varname">KRB5_ACCEPTED</code> to choose between adding a dependency on Heimdal or MIT-krb5 for packages that require a Kerberos 5 implementation.</p> </li> <li> - <p><tt class="filename">motif.buildlink3.mk</tt> - checks for a system-provided Motif installation or - adds a dependency on <a xmlns= + <p><code class= + "filename">motif.buildlink3.mk</code> checks for a + system-provided Motif installation or adds a + dependency on <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/lesstif/README.html" - class="pkgname">x11/lesstif</a> or <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/openmotif/README.html" - class="pkgname">x11/openmotif</a>;</p> + class="pkgname">x11/lesstif</a> or <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/openmotif/README.html" + class="pkgname">x11/openmotif</a>;</p> </li> <li> - <p><tt class="filename">ossaudio.buildlink3.mk</tt> - defines several variables that may be used by - packages that use the Open Sound System (OSS) - API;</p> + <p><code class= + "filename">ossaudio.buildlink3.mk</code> defines + several variables that may be used by packages that + use the Open Sound System (OSS) API;</p> </li> <li> - <p><tt class="filename">pgsql.buildlink3.mk</tt> - will accept either Postgres 7.3 or 7.4, whichever - is found installed. See the file for more - information.</p> + <p><code class= + "filename">pgsql.buildlink3.mk</code> will accept + either Postgres 7.3 or 7.4, whichever is found + installed. See the file for more information.</p> </li> <li> - <p><tt class="filename">pthread.buildlink3.mk</tt> - uses the value of <tt class= - "varname">PTHREAD_OPTS</tt> and checks for native - pthreads or adds a dependency on <a xmlns= + <p><code class= + "filename">pthread.buildlink3.mk</code> uses the + value of <code class="varname">PTHREAD_OPTS</code> + and checks for native pthreads or adds a dependency + on <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/pth/README.html" - class="pkgname">devel/pth</a> as needed;</p> + class="pkgname">devel/pth</a> as needed;</p> </li> <li> - <p><tt class="filename">xaw.buildlink3.mk</tt> uses - the value of <tt class="varname">XAW_TYPE</tt> to - choose a particular Athena widgets library.</p> + <p><code class="filename">xaw.buildlink3.mk</code> + uses the value of <code class= + "varname">XAW_TYPE</code> to choose a particular + Athena widgets library.</p> </li> </ul> </div> - <p>The comments in those <tt class= - "filename">buildlink3.mk</tt> files provide a more + <p>The comments in those <code class= + "filename">buildlink3.mk</code> files provide a more complete description of how to use them properly.</p> </div> @@ -5869,54 +5955,56 @@ DEPENDS+= foo>=1.1.0:../../category/foo <div> <div> <h2 class="title" style="clear: both"><a name= - "id2567532" id="id2567532"></a>9.2. Writing - <tt class="filename">buildlink3.mk</tt> files</h2> + "id2587265" id="id2587265"></a>9.2. Writing + <code class="filename">buildlink3.mk</code> + files</h2> </div> </div> </div> - <p>A package's <tt class="filename">buildlink3.mk</tt> - file is included by Makefiles to indicate the need to - compile and link against header files and libraries - provided by the package. A <tt class= - "filename">buildlink3.mk</tt> file should always provide - enough information to add the correct type of dependency - relationship and include any other <tt class= - "filename">buildlink3.mk</tt> files that it needs to find - headers and libraries that it needs in turn.</p> + <p>A package's <code class= + "filename">buildlink3.mk</code> file is included by + Makefiles to indicate the need to compile and link + against header files and libraries provided by the + package. A <code class="filename">buildlink3.mk</code> + file should always provide enough information to add the + correct type of dependency relationship and include any + other <code class="filename">buildlink3.mk</code> files + that it needs to find headers and libraries that it needs + in turn.</p> - <p>To generate an initial <tt class= - "filename">buildlink3.mk</tt> file for further editing, + <p>To generate an initial <code class= + "filename">buildlink3.mk</code> file for further editing, Rene Hexel's <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/createbuildlink/README.html" - class="pkgname">pkgtools/createbuildlink</a> package - is highly recommended. For most packages, the - following command will generate a good starting point - for <tt class="filename">buildlink3.mk</tt> files:</p> + class="pkgname">pkgtools/createbuildlink</a> package is + highly recommended. For most packages, the following + command will generate a good starting point for + <code class="filename">buildlink3.mk</code> files:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>cd pkgsrc/<i class= -"replaceable"><tt>category</tt></i>/<i class= -"replaceable"><tt>pkgdir</tt></i> -<tt class= -"prompt">%</tt> createbuildlink -3 >buildlink3.mk</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>cd pkgsrc/<em class= +"replaceable"><code>category</code></em>/<em class= +"replaceable"><code>pkgdir</code></em> +<code class= +"prompt">%</code> createbuildlink -3 >buildlink3.mk</code></strong> </pre> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2567670" id= - "id2567670"></a>9.2.1. Anatomy of a buildlink3.mk + <h3 class="title"><a name="id2587470" id= + "id2587470"></a>9.2.1. Anatomy of a buildlink3.mk file</h3> </div> </div> </div> - <p>The following real-life example <tt class= - "filename">buildlink3.mk</tt> is taken from <tt class= - "filename">pkgsrc/graphics/tiff</tt>:</p> + <p>The following real-life example <code class= + "filename">buildlink3.mk</code> is taken from + <code class="filename">pkgsrc/graphics/tiff</code>:</p> <pre class="programlisting"> # $NetBSD: buildlink3.mk,v 1.7 2004/03/18 09:12:12 jlam Exp $ @@ -5941,84 +6029,88 @@ BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} </pre> - <p>The header and footer manipulate <tt class= - "varname">BUILDLINK_DEPTH</tt>, which is common across - all <tt class="filename">buildlink3.mk</tt> files and - is used to track at what depth we are including - <tt class="filename">buildlink3.mk</tt> files.</p> + <p>The header and footer manipulate <code class= + "varname">BUILDLINK_DEPTH</code>, which is common + across all <code class="filename">buildlink3.mk</code> + files and is used to track at what depth we are + including <code class="filename">buildlink3.mk</code> + files.</p> <p>The first section controls if the dependency on - <i class="replaceable"><tt>pkg</tt></i> is added. - <tt class="varname">BUILDLINK_DEPENDS</tt> is the + <em class="replaceable"><code>pkg</code></em> is added. + <code class="varname">BUILDLINK_DEPENDS</code> is the global list of packages for which dependencies are added by buildlink3.</p> <p>The second section advises pkgsrc that the - <tt class="filename">buildlink3.mk</tt> file for - <i class="replaceable"><tt>pkg</tt></i> has been - included at some point. <tt class= - "varname">BUILDLINK_PACKAGES</tt> is the global list of - packages for which <tt class= - "filename">buildlink3.mk</tt> files have been included. - It must <span class="emphasis"><em>always</em></span> - be appended to within a <tt class= - "filename">buildlink3.mk</tt> file.</p> + <code class="filename">buildlink3.mk</code> file for + <em class="replaceable"><code>pkg</code></em> has been + included at some point. <code class= + "varname">BUILDLINK_PACKAGES</code> is the global list + of packages for which <code class= + "filename">buildlink3.mk</code> files have been + included. It must <span class= + "emphasis"><em>always</em></span> be appended to within + a <code class="filename">buildlink3.mk</code> file.</p> <p>The third section is protected from multiple - inclusion and controls how the dependency on <i class= - "replaceable"><tt>pkg</tt></i> is added. Several + inclusion and controls how the dependency on <em class= + "replaceable"><code>pkg</code></em> is added. Several important variables are set in the section:</p> <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class= - "varname">BUILDLINK_DEPENDS.<i class="replaceable"> - <tt>pkg</tt></i></tt> is the actual dependency - recorded in the installed package; this should - always be set using <span><b class= - "command">+=</b></span> to ensure that we're - appending to any pre-existing list of values. - This variable should be set to the first version - of the package that had the last change in the - major number of a shared library or that had a - major API change.</p> + <p><code class= + "varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code> is the + actual dependency recorded in the installed + package; this should always be set using + <span><strong class="command">+=</strong></span> + to ensure that we're appending to any + pre-existing list of values. This variable should + be set to the first version of the package that + had the last change in the major number of a + shared library or that had a major API + change.</p> </li> <li> - <p><tt class= - "varname">BUILDLINK_PKGSRCDIR.<i class= - "replaceable"><tt>pkg</tt></i></tt> is the - location of the <i class= - "replaceable"><tt>pkg</tt></i> pkgsrc + <p><code class= + "varname">BUILDLINK_PKGSRCDIR.<em class= + "replaceable"><code>pkg</code></em></code> is the + location of the <em class= + "replaceable"><code>pkg</code></em> pkgsrc directory;</p> </li> <li> - <p><tt class= - "varname">BUILDLINK_DEPMETHOD.<i class= - "replaceable"><tt>pkg</tt></i></tt> (not shown - above) controls whether we use <tt class= - "varname">BUILD_DEPENDS</tt> or <tt class= - "varname">DEPENDS</tt> to add the dependency on - <i class="replaceable"><tt>pkg</tt></i>. The - build dependency is selected by setting - <tt class="varname">BUILDLINK_DEPMETHOD.<i class= - "replaceable"><tt>pkg</tt></i></tt> to + <p><code class= + "varname">BUILDLINK_DEPMETHOD.<em class= + "replaceable"><code>pkg</code></em></code> (not + shown above) controls whether we use <code class= + "varname">BUILD_DEPENDS</code> or <code class= + "varname">DEPENDS</code> to add the dependency on + <em class="replaceable"><code>pkg</code></em>. + The build dependency is selected by setting + <code class= + "varname">BUILDLINK_DEPMETHOD.<em class= + "replaceable"><code>pkg</code></em></code> to “<span class="quote">build</span>”. By default, the full dependency is used.</p> </li> <li> - <p><tt class= - "varname">BUILDLINK_INCDIRS.<i class="replaceable"> - <tt>pkg</tt></i></tt> and <tt class= - "varname">BUILDLINK_LIBDIRS.<i class= - "replaceable"><tt>pkg</tt></i></tt> (not shown - above) are lists of subdirectories of <tt class= - "filename">${BUILDLINK_PREFIX.<i class= - "replaceable"><tt>pkg</tt></i>}</tt> to add to - the header and library search paths. These + <p><code class= + "varname">BUILDLINK_INCDIRS.<em class= + "replaceable"><code>pkg</code></em></code> and + <code class= + "varname">BUILDLINK_LIBDIRS.<em class="replaceable"> + <code>pkg</code></em></code> (not shown above) + are lists of subdirectories of <code class= + "filename">${BUILDLINK_PREFIX.<em class= + "replaceable"><code>pkg</code></em>}</code> to + add to the header and library search paths. These default to “<span class= "quote">include</span>” and “<span class="quote">lib</span>” @@ -6026,17 +6118,18 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} </li> <li> - <p><tt class= - "varname">BUILDLINK_CPPFLAGS.<i class= - "replaceable"><tt>pkg</tt></i></tt> (not shown - above) is the list of preprocessor flags to add - to <tt class="varname">CPPFLAGS</tt>, which are - passed on to the configure and build phases. The - “<span class="quote">-I</span>” - option should be avoided and instead be handled - using <tt class= - "varname">BUILDLINK_INCDIRS.<i class= - "replaceable"><tt>pkg</tt></i></tt> as above.</p> + <p><code class= + "varname">BUILDLINK_CPPFLAGS.<em class= + "replaceable"><code>pkg</code></em></code> (not + shown above) is the list of preprocessor flags to + add to <code class="varname">CPPFLAGS</code>, + which are passed on to the configure and build + phases. The “<span class= + "quote">-I</span>” option should be avoided + and instead be handled using <code class= + "varname">BUILDLINK_INCDIRS.<em class= + "replaceable"><code>pkg</code></em></code> as + above.</p> </li> </ul> </div> @@ -6044,103 +6137,110 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <p>The following variables are all optionally defined within this second section (protected against multiple inclusion) and control which package files are - symlinked into <tt class= - "filename">${BUILDLINK_DIR}</tt> and how their names + symlinked into <code class= + "filename">${BUILDLINK_DIR}</code> and how their names are transformed during the symlinking:</p> <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class="varname">BUILDLINK_FILES.<i class= - "replaceable"><tt>pkg</tt></i></tt> (not shown - above) is a shell glob pattern relative to - <tt class="filename">${BUILDLINK_PREFIX.<i class= - "replaceable"><tt>pkg</tt></i>}</tt> to be - symlinked into <tt class= - "filename">${BUILDLINK_DIR}</tt>, e.g. <tt class= - "filename">include/*.h</tt>.</p> + <p><code class= + "varname">BUILDLINK_FILES.<em class= + "replaceable"><code>pkg</code></em></code> (not + shown above) is a shell glob pattern relative to + <code class= + "filename">${BUILDLINK_PREFIX.<em class= + "replaceable"><code>pkg</code></em>}</code> to be + symlinked into <code class= + "filename">${BUILDLINK_DIR}</code>, e.g. + <code class="filename">include/*.h</code>.</p> </li> <li> - <p><tt class= - "varname">BUILDLINK_FILES_CMD.<i class= - "replaceable"><tt>pkg</tt></i></tt> (not shown - above) is a shell pipeline that outputs to stdout - a list of files relative to <tt class= - "filename">${BUILDLINK_PREFIX.<i class= - "replaceable"><tt>pkg</tt></i>}</tt>. The + <p><code class= + "varname">BUILDLINK_FILES_CMD.<em class= + "replaceable"><code>pkg</code></em></code> (not + shown above) is a shell pipeline that outputs to + stdout a list of files relative to <code class= + "filename">${BUILDLINK_PREFIX.<em class= + "replaceable"><code>pkg</code></em>}</code>. The resulting files are to be symlinked into - <tt class="filename">${BUILDLINK_DIR}</tt>. By - default, this takes the <tt class= - "filename">+CONTENTS</tt> of a <i class= - "replaceable"><tt>pkg</tt></i> and filters it - through <tt class= - "varname">${BUILDLINK_CONTENTS_FILTER.<i class= - "replaceable"><tt>pkg</tt></i>}</tt>.</p> + <code class="filename">${BUILDLINK_DIR}</code>. + By default, this takes the <code class= + "filename">+CONTENTS</code> of a <em class= + "replaceable"><code>pkg</code></em> and filters + it through <code class= + "varname">${BUILDLINK_CONTENTS_FILTER.<em class= + "replaceable"><code>pkg</code></em>}</code>.</p> </li> <li> - <p><tt class= - "varname">BUILDLINK_CONTENTS_FILTER.<i class= - "replaceable"><tt>pkg</tt></i></tt> (not shown - above) is a filter command that filters - <tt class="filename">+CONTENTS</tt> input into a - list of files relative to <tt class= - "filename">${BUILDLINK_PREFIX.<i class= - "replaceable"><tt>pkg</tt></i>}</tt> on stdout. - By default for overwrite packages, <tt class= - "varname">BUILDLINK_CONTENTS_FILTER.<i class= - "replaceable"><tt>pkg</tt></i></tt> outputs the - contents of the <tt class="filename">include</tt> - and <tt class="filename">lib</tt> directories in - the package <tt class="filename">+CONTENTS</tt>, - and for pkgviews packages, it outputs any libtool - archives in <tt class="filename">lib</tt> + <p><code class= + "varname">BUILDLINK_CONTENTS_FILTER.<em class= + "replaceable"><code>pkg</code></em></code> (not + shown above) is a filter command that filters + <code class="filename">+CONTENTS</code> input + into a list of files relative to <code class= + "filename">${BUILDLINK_PREFIX.<em class= + "replaceable"><code>pkg</code></em>}</code> on + stdout. By default for overwrite packages, + <code class= + "varname">BUILDLINK_CONTENTS_FILTER.<em class= + "replaceable"><code>pkg</code></em></code> + outputs the contents of the <code class= + "filename">include</code> and <code class= + "filename">lib</code> directories in the package + <code class="filename">+CONTENTS</code>, and for + pkgviews packages, it outputs any libtool + archives in <code class="filename">lib</code> directories.</p> </li> <li> - <p><tt class= - "varname">BUILDLINK_TRANSFORM.<i class= - "replaceable"><tt>pkg</tt></i></tt> (not shown - above) is a list of sed arguments used to + <p><code class= + "varname">BUILDLINK_TRANSFORM.<em class= + "replaceable"><code>pkg</code></em></code> (not + shown above) is a list of sed arguments used to transform the name of the source filename into a - destination filename, e.g. <span><b class= + destination filename, e.g. <span><strong class= "command">-e - "s|/curses.h|/ncurses.h|g"</b></span>.</p> + "s|/curses.h|/ncurses.h|g"</strong></span>.</p> </li> </ul> </div> - <p>The last section includes any <tt class= - "filename">buildlink3.mk</tt> needed for <i class= - "replaceable"><tt>pkg</tt></i>'s library dependencies. - Including these <tt class="filename">buildlink3.mk</tt> - files means that the headers and libraries for these - dependencies are also symlinked into <tt class= - "filename">${BUILDLINK_DIR}</tt> whenever the <i class= - "replaceable"><tt>pkg</tt></i> <tt class= - "filename">buildlink3.mk</tt> file is included.</p> + <p>The last section includes any <code class= + "filename">buildlink3.mk</code> needed for <em class= + "replaceable"><code>pkg</code></em>'s library + dependencies. Including these <code class= + "filename">buildlink3.mk</code> files means that the + headers and libraries for these dependencies are also + symlinked into <code class= + "filename">${BUILDLINK_DIR}</code> whenever the + <em class="replaceable"><code>pkg</code></em> + <code class="filename">buildlink3.mk</code> file is + included.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2568110" id= - "id2568110"></a>9.2.2. Updating <tt class= - "varname">BUILDLINK_DEPENDS.<i class= - "replaceable"><tt>pkg</tt></i></tt> in <tt class= - "filename">buildlink3.mk</tt> files</h3> + <h3 class="title"><a name="id2588048" id= + "id2588048"></a>9.2.2. Updating <code class= + "varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code> in + <code class="filename">buildlink3.mk</code> + files</h3> </div> </div> </div> <p>There are two situations that require increasing the - dependency listed in <tt class= - "varname">BUILDLINK_DEPENDS.<i class= - "replaceable"><tt>pkg</tt></i></tt> after a package - update:</p> + dependency listed in <code class= + "varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code> after a + package update:</p> <div class="orderedlist"> <ol type="1"> @@ -6157,35 +6257,37 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} </ol> </div> - <p>In these cases, <tt class= - "varname">BUILDLINK_DEPENDS.<i class= - "replaceable"><tt>pkg</tt></i></tt> should be adjusted - to require at least the new package version. In some - cases, the packages that depend on this new version may - need their <tt class="varname">PKGREVISION</tt>s - increased and, if they have <tt class= - "filename">buildlink3.mk</tt> files, their <tt class= - "varname">BUILDLINK_DEPENDS.<i class= - "replaceable"><tt>pkg</tt></i></tt> adjusted, too. This - is needed so that binary packages made using it will - require the correct package dependency and not settle - for an older one which will not contain the necessary - shared libraries.</p> + <p>In these cases, <code class= + "varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code> should be + adjusted to require at least the new package version. + In some cases, the packages that depend on this new + version may need their <code class= + "varname">PKGREVISION</code>s increased and, if they + have <code class="filename">buildlink3.mk</code> files, + their <code class= + "varname">BUILDLINK_DEPENDS.<em class="replaceable"><code> + pkg</code></em></code> adjusted, too. This is needed so + that binary packages made using it will require the + correct package dependency and not settle for an older + one which will not contain the necessary shared + libraries.</p> <p>Please take careful consideration before adjusting - <tt class="varname">BUILDLINK_DEPENDS.<i class= - "replaceable"><tt>pkg</tt></i></tt> as we don't want to - cause unneeded package deletions and rebuilds. In many - cases, new versions of packages work just fine with - older dependencies. See <a href="#dependencies" title= - "12.1.3. Handling dependencies">Section 12.1.3, - “Handling dependencies”</a> and <a href= - "#buildlink" title= + <code class="varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code> as we don't + want to cause unneeded package deletions and rebuilds. + In many cases, new versions of packages work just fine + with older dependencies. See <a href="#dependencies" + title="12.1.3. Handling dependencies">Section + 12.1.3, “Handling dependencies”</a> and + <a href="#buildlink" title= "Chapter 9. Buildlink methodology">Chapter 9, <i>Buildlink methodology</i></a> for more information about dependencies on other packages, including the - <tt class="varname">BUILDLINK_RECOMMENDED</tt> and - <tt class="varname">RECOMMENDED</tt> definitions.</p> + <code class="varname">BUILDLINK_RECOMMENDED</code> and + <code class="varname">RECOMMENDED</code> + definitions.</p> </div> </div> @@ -6194,50 +6296,50 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <div> <div> <h2 class="title" style="clear: both"><a name= - "id2568189" id="id2568189"></a>9.3. Writing - <tt class="filename">builtin.mk</tt> files</h2> + "id2588126" id="id2588126"></a>9.3. Writing + <code class="filename">builtin.mk</code> files</h2> </div> </div> </div> <p>Some packages in pkgsrc install headers and libraries that coincide with headers and libraries present in the - base system. Aside from a <tt class= - "filename">buildlink3.mk</tt> file, these packages should - also include a <tt class="filename">builtin.mk</tt> file - that includes the necessary checks to decide whether - using the built-in software or the pkgsrc software is - appropriate.</p> + base system. Aside from a <code class= + "filename">buildlink3.mk</code> file, these packages + should also include a <code class= + "filename">builtin.mk</code> file that includes the + necessary checks to decide whether using the built-in + software or the pkgsrc software is appropriate.</p> <p>The only requirements of a builtin.mk file for - <i class="replaceable"><tt>pkg</tt></i> are:</p> + <em class="replaceable"><code>pkg</code></em> are:</p> <div class="orderedlist"> <ol type="1"> <li> - <p>It should set <tt class= - "varname">USE_BUILTIN.<i class= - "replaceable"><tt>pkg</tt></i></tt> to either - “<span class="quote">yes</span>” or - “<span class="quote">no</span>” after - it is included.</p> + <p>It should set <code class= + "varname">USE_BUILTIN.<em class= + "replaceable"><code>pkg</code></em></code> to + either “<span class="quote">yes</span>” + or “<span class="quote">no</span>” + after it is included.</p> </li> <li> <p>It should <span class= "emphasis"><em>not</em></span> override any - <tt class="varname">USE_BUILTIN.<i class= - "replaceable"><tt>pkg</tt></i></tt> which is - already set before the <tt class= - "filename">builtin.mk</tt> file is included.</p> + <code class="varname">USE_BUILTIN.<em class= + "replaceable"><code>pkg</code></em></code> which is + already set before the <code class= + "filename">builtin.mk</code> file is included.</p> </li> <li> <p>It should be written to allow multiple inclusion. This is <span class= "emphasis"><em>very</em></span> important and takes - careful attention to <tt class= - "filename">Makefile</tt> coding.</p> + careful attention to <code class= + "filename">Makefile</code> coding.</p> </li> </ol> </div> @@ -6246,9 +6348,10 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2568270" id= - "id2568270"></a>9.3.1. Anatomy of a - <tt class="filename">builtin.mk</tt> file</h3> + <h3 class="title"><a name="id2588208" id= + "id2588208"></a>9.3.1. Anatomy of a + <code class="filename">builtin.mk</code> + file</h3> </div> </div> </div> @@ -6297,80 +6400,82 @@ CHECK_BUILTIN.foo?= no </pre> - <p>The first section sets <tt class= - "varname">IS_BUILTIN.<i class= - "replaceable"><tt>pkg</tt></i></tt> depending on if - <i class="replaceable"><tt>pkg</tt></i> really exists - in the base system. This should not be a base system - software with similar functionality to <i class= - "replaceable"><tt>pkg</tt></i>; it should only be - “<span class="quote">yes</span>” if the - actual package is included as part of the base system. - This variable is only used internally within the - <tt class="filename">builtin.mk</tt> file.</p> - - <p>The second section sets <tt class= - "varname">BUILTIN_PKG.<i class= - "replaceable"><tt>pkg</tt></i></tt> to the version of - <i class="replaceable"><tt>pkg</tt></i> in the base - system if it exists (if <tt class= - "varname">IS_BUILTIN.<i class= - "replaceable"><tt>pkg</tt></i></tt> is + <p>The first section sets <code class= + "varname">IS_BUILTIN.<em class= + "replaceable"><code>pkg</code></em></code> depending on + if <em class="replaceable"><code>pkg</code></em> really + exists in the base system. This should not be a base + system software with similar functionality to + <em class="replaceable"><code>pkg</code></em>; it + should only be “<span class= + "quote">yes</span>” if the actual package is + included as part of the base system. This variable is + only used internally within the <code class= + "filename">builtin.mk</code> file.</p> + + <p>The second section sets <code class= + "varname">BUILTIN_PKG.<em class= + "replaceable"><code>pkg</code></em></code> to the + version of <em class= + "replaceable"><code>pkg</code></em> in the base system + if it exists (if <code class= + "varname">IS_BUILTIN.<em class= + "replaceable"><code>pkg</code></em></code> is “<span class="quote">yes</span>”). This - variable is only used internally within the <tt class= - "filename">builtin.mk</tt> file.</p> - - <p>The third section sets <tt class= - "varname">USE_BUILTIN.<i class= - "replaceable"><tt>pkg</tt></i></tt> and is <span class= - "emphasis"><em>required</em></span> in all <tt class= - "filename">builtin.mk</tt> files. The code in this - section must make the determination whether the - built-in software is adequate to satisfy the - dependencies listed in <tt class= - "varname">BUILDLINK_DEPENDS.<i class= - "replaceable"><tt>pkg</tt></i></tt>. This is typically - done by comparing <tt class= - "varname">BUILTIN_PKG.<i class= - "replaceable"><tt>pkg</tt></i></tt> against each of the - dependencies in <tt class= - "varname">BUILDLINK_DEPENDS.<i class= - "replaceable"><tt>pkg</tt></i></tt>. <tt class= - "varname">USE_BUILTIN.<i class= - "replaceable"><tt>pkg</tt></i></tt> <span class= + variable is only used internally within the + <code class="filename">builtin.mk</code> file.</p> + + <p>The third section sets <code class= + "varname">USE_BUILTIN.<em class= + "replaceable"><code>pkg</code></em></code> and is + <span class="emphasis"><em>required</em></span> in all + <code class="filename">builtin.mk</code> files. The + code in this section must make the determination + whether the built-in software is adequate to satisfy + the dependencies listed in <code class= + "varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code>. This is + typically done by comparing <code class= + "varname">BUILTIN_PKG.<em class= + "replaceable"><code>pkg</code></em></code> against each + of the dependencies in <code class= + "varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code>. + <code class="varname">USE_BUILTIN.<em class= + "replaceable"><code>pkg</code></em></code> <span class= "emphasis"><em>must</em></span> be set to the correct - value by the end of the <tt class= - "filename">builtin.mk</tt> file. Note that <tt class= - "varname">USE_BUILTIN.<i class= - "replaceable"><tt>pkg</tt></i></tt> may be + value by the end of the <code class= + "filename">builtin.mk</code> file. Note that + <code class="varname">USE_BUILTIN.<em class= + "replaceable"><code>pkg</code></em></code> may be “<span class="quote">yes</span>” even if - <tt class="varname">IS_BUILTIN.<i class= - "replaceable"><tt>pkg</tt></i></tt> is + <code class="varname">IS_BUILTIN.<em class= + "replaceable"><code>pkg</code></em></code> is “<span class="quote">no</span>” because we may make the determination that the built-in version of the software is similar enough to be used as a replacement.</p> - <p>The last section is guarded by <tt class= - "varname">CHECK_BUILTIN.<i class= - "replaceable"><tt>pkg</tt></i></tt>, and includes code - that uses the value of <tt class= - "varname">USE_BUILTIN.<i class= - "replaceable"><tt>pkg</tt></i></tt> set in the previous - section. This typically includes, e.g., adding + <p>The last section is guarded by <code class= + "varname">CHECK_BUILTIN.<em class= + "replaceable"><code>pkg</code></em></code>, and + includes code that uses the value of <code class= + "varname">USE_BUILTIN.<em class= + "replaceable"><code>pkg</code></em></code> set in the + previous section. This typically includes, e.g., adding additional dependency restrictions and listing - additional files to symlink into <tt class= - "filename">${BUILDLINK_DIR}</tt> (via <tt class= - "varname">BUILDLINK_FILES.<i class= - "replaceable"><tt>pkg</tt></i></tt>).</p> + additional files to symlink into <code class= + "filename">${BUILDLINK_DIR}</code> (via <code class= + "varname">BUILDLINK_FILES.<em class= + "replaceable"><code>pkg</code></em></code>).</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2568566" id= - "id2568566"></a>9.3.2. Global preferences + <h3 class="title"><a name="id2588366" id= + "id2588366"></a>9.3.2. Global preferences for native or pkgsrc software</h3> </div> </div> @@ -6380,24 +6485,24 @@ CHECK_BUILTIN.foo?= no whether to set a global preference for using either the built-in (native) version or the pkgsrc version of software to satisfy a dependency. This is controlled by - setting <tt class="varname">PREFER_PKGSRC</tt> and - <tt class="varname">PREFER_NATIVE</tt>. These variables - take values of either “<span class= + setting <code class="varname">PREFER_PKGSRC</code> and + <code class="varname">PREFER_NATIVE</code>. These + variables take values of either “<span class= "quote">yes</span>”, “<span class= "quote">no</span>”, or a list of packages. - <tt class="varname">PREFER_PKGSRC</tt> tells pkgsrc to - use the pkgsrc versions of software, while <tt class= - "varname">PREFER_NATIVE</tt> tells pkgsrc to use the - built-in versions. Preferences are determined by the - most specific instance of the package in either - <tt class="varname">PREFER_PKGSRC</tt> or <tt class= - "varname">PREFER_NATIVE</tt>. If a package is specified - in neither or in both variables, then <tt class= - "varname">PREFER_PKGSRC</tt> has precedence over - <tt class="varname">PREFER_NATIVE</tt>. For example, to - require using pkgsrc versions of software for all but - the most basic bits on a NetBSD system, you can - set:</p> + <code class="varname">PREFER_PKGSRC</code> tells pkgsrc + to use the pkgsrc versions of software, while + <code class="varname">PREFER_NATIVE</code> tells pkgsrc + to use the built-in versions. Preferences are + determined by the most specific instance of the package + in either <code class="varname">PREFER_PKGSRC</code> or + <code class="varname">PREFER_NATIVE</code>. If a + package is specified in neither or in both variables, + then <code class="varname">PREFER_PKGSRC</code> has + precedence over <code class= + "varname">PREFER_NATIVE</code>. For example, to require + using pkgsrc versions of software for all but the most + basic bits on a NetBSD system, you can set:</p> <pre class="programlisting"> PREFER_PKGSRC= yes PREFER_NATIVE= getopt skey tcp_wrappers @@ -6405,10 +6510,10 @@ CHECK_BUILTIN.foo?= no </pre> <p>A package <span class= - "emphasis"><em>must</em></span> have a <tt class= - "filename">builtin.mk</tt> file to be listed in - <tt class="varname">PREFER_NATIVE</tt>, otherwise it is - simply ignored in that list.</p> + "emphasis"><em>must</em></span> have a <code class= + "filename">builtin.mk</code> file to be listed in + <code class="varname">PREFER_NATIVE</code>, otherwise + it is simply ignored in that list.</p> </div> </div> </div> @@ -6428,18 +6533,18 @@ CHECK_BUILTIN.foo?= no <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2568638">10.1. + <dt><span class="sect1"><a href="#id2588507">10.1. Global default options</a></span></dt> - <dt><span class="sect1"><a href="#id2568653">10.2. - Converting packages to use - bsd.options.mk</a></span></dt> + <dt><span class="sect1"><a href="#id2588522">10.2. + Converting packages to use <code class= + "filename">bsd.options.mk</code></a></span></dt> </dl> </div> <p>Many packages have the ability to be built to support - different sets of features. <tt class= - "filename">bsd.options.mk</tt> is a framework in pkgsrc + different sets of features. <code class= + "filename">bsd.options.mk</code> is a framework in pkgsrc that provides generic handling of those options that determine different ways in which the packages can be built. It's possible for the user to specify exactly which @@ -6451,17 +6556,17 @@ CHECK_BUILTIN.foo?= no <div> <div> <h2 class="title" style="clear: both"><a name= - "id2568638" id="id2568638"></a>10.1. Global + "id2588507" id="id2588507"></a>10.1. Global default options</h2> </div> </div> </div> - <p>Global default options are listed in <tt class= - "varname">PKG_DEFAULT_OPTIONS</tt>, which is a list of + <p>Global default options are listed in <code class= + "varname">PKG_DEFAULT_OPTIONS</code>, which is a list of the options that should be built into every package if that option is supported. This variable should be set in - <tt class="filename">/etc/mk.conf</tt>.</p> + <code class="filename">/etc/mk.conf</code>.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -6469,18 +6574,20 @@ CHECK_BUILTIN.foo?= no <div> <div> <h2 class="title" style="clear: both"><a name= - "id2568653" id= - "id2568653"></a>10.2. Converting packages to - use <tt class="filename">bsd.options.mk</tt></h2> + "id2588522" id= + "id2588522"></a>10.2. Converting packages to + use <code class= + "filename">bsd.options.mk</code></h2> </div> </div> </div> - <p>The following example shows how <tt class= - "filename">bsd.options.mk</tt> should be use in a package - <tt class="filename">Makefile</tt>, or in a file, e.g. - <tt class="filename">options.mk</tt>, that is included by - the main package <tt class="filename">Makefile</tt>.</p> + <p>The following example shows how <code class= + "filename">bsd.options.mk</code> should be use 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">Makefile</code>.</p> <pre class="programlisting"> # Global and legacy options .if defined(WIBBLE_USE_OPENLDAP) && !empty(WIBBLE_USE_OPENLDAP:M[yY][eE][sS]) @@ -6522,12 +6629,12 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} <p>The first section only exists if you are converting a package that had its own ad-hoc options handling to use - <tt class="filename">bsd.options.mk</tt>. It converts + <code class="filename">bsd.options.mk</code>. It converts global or legacy options variables into an equivalent - <tt class="varname">PKG_OPTIONS.<i class= - "replaceable"><tt>pkg</tt></i></tt> value. These sections - will be removed over time as the old options are in turn - deprecated and removed.</p> + <code class="varname">PKG_OPTIONS.<em class= + "replaceable"><code>pkg</code></em></code> value. These + sections will be removed over time as the old options are + in turn deprecated and removed.</p> <p>The second section contains the information about which build options are supported by the package, and any @@ -6536,33 +6643,33 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} <div class="orderedlist"> <ol type="1"> <li> - <p><tt class="varname">PKG_OPTIONS_VAR</tt> is a - list of the name of the <a href= + <p><code class="varname">PKG_OPTIONS_VAR</code> is + a list of 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.<i class= - "replaceable"><tt>pkg</tt></i></span>” but - any package-specific value may be used. This + "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> </li> <li> - <p><tt class="varname">PKG_SUPPORTED_OPTIONS</tt> - is a list of build options supported by the - package. This variable should be set in a package - Makefile.</p> + <p><code class= + "varname">PKG_SUPPORTED_OPTIONS</code> is a list of + build options supported by the package. This + variable should be set in a package Makefile.</p> </li> <li> - <p><tt class="varname">${PKG_OPTIONS_VAR}</tt> (the - variables named in <tt class= - "varname">PKG_OPTIONS_VAR</tt>) are variables that - list the selected build options and override any - default options given in <tt class= - "varname">PKG_DEFAULT_OPTIONS</tt>. If any of the + <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= + "varname">PKG_DEFAULT_OPTIONS</code>. If any of the options begin with a “<span class= "quote">-</span>”, then that option is always removed from the selected build options, e.g.</p> @@ -6582,8 +6689,8 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} </pre> - <p>This variable should be set in <tt class= - "filename">/etc/mk.conf</tt>.</p> + <p>This variable should be set in <code class= + "filename">/etc/mk.conf</code>.</p> </li> </ol> </div> @@ -6594,22 +6701,22 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class="varname">PKG_OPTIONS</tt> contains - the list of the selected build options, properly - filtered to remove unsupported and duplicate - options.</p> + <p><code class="varname">PKG_OPTIONS</code> + contains the list of the selected build options, + properly filtered to remove unsupported and + duplicate options.</p> </li> </ul> </div> <p>The remaining sections contain the logic that is specific to each option. There should be a check for - every option listed in <tt class= - "varname">PKG_SUPPORTED_OPTIONS</tt>, and there should be - clear documentation on what turning on the option will do - in the comments preceding each section. The correct way - to check for an option is to check whether it is listed - in <tt class="varname">PKG_OPTIONS</tt>.</p> + every option listed in <code class= + "varname">PKG_SUPPORTED_OPTIONS</code>, and there should + be clear documentation on what turning on the option will + do in the comments preceding each section. The correct + way to check for an option is to check whether it is + listed in <code class="varname">PKG_OPTIONS</code>.</p> </div> </div> @@ -6631,7 +6738,7 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} <dt><span class="sect1"><a href="#build.prefix">11.1. Program location</a></span></dt> - <dt><span class="sect1"><a href="#id2569330">11.2. Main + <dt><span class="sect1"><a href="#id2589198">11.2. Main targets</a></span></dt> <dt><span class="sect1"><a href= @@ -6649,8 +6756,8 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} the generated binaries, etc. can be put into place on the system. These are exactly the steps performed by the NetBSD package system, which is implemented as a series of targets - in a central Makefile, <tt class= - "filename">pkgsrc/mk/bsd.pkg.mk</tt>.</p> + in a central Makefile, <code class= + "filename">pkgsrc/mk/bsd.pkg.mk</code>.</p> <div class="sect1" lang="en" xml:lang="en"> <div class="titlepage"> @@ -6668,16 +6775,16 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} discussion on where programs are installed, and which variables influence this.</p> - <p>The automatic variable <tt class="varname">PREFIX</tt> - indicates where all files of the final program shall be - installed. It is usually set to <tt class= - "varname">LOCALBASE</tt> (<tt class= - "filename">/usr/pkg</tt>), or <tt class= - "varname">CROSSBASE</tt> for pkgs in the + <p>The automatic variable <code class= + "varname">PREFIX</code> indicates where all files of the + final program shall be installed. It is usually set to + <code class="varname">LOCALBASE</code> (<code class= + "filename">/usr/pkg</code>), or <code class= + "varname">CROSSBASE</code> for pkgs in the “<span class="quote">cross</span>” category. - The value of <tt class="varname">PREFIX</tt> needs to be - put into the various places in the program's source where - paths to these files are encoded. See <a href= + The value of <code class="varname">PREFIX</code> needs to + be put into the various places in the program's source + where paths to these files are encoded. See <a href= "#components.patches" title= "7.3. patches/*">Section 7.3, “patches/*”</a> and <a href="#fixes.libtool" @@ -6692,16 +6799,16 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class="varname">PREFIX</tt> always points to - the location where the current pkg will be - installed. When referring to a pkg's own + <p><code class="varname">PREFIX</code> always + points to the location where the current pkg will + be installed. When referring to a pkg's own installation path, use “<span class= "quote">${PREFIX}</span>”.</p> </li> <li> - <p><tt class="varname">LOCALBASE</tt> is where all - non-X11 pkgs are installed. If you need to + <p><code class="varname">LOCALBASE</code> is where + all non-X11 pkgs are installed. If you need to construct a -I or -L argument to the compiler to find includes and libraries installed by another non-X11 pkg, use “<span class= @@ -6709,8 +6816,8 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} </li> <li> - <p><tt class="varname">X11BASE</tt> is where the - actual X11 distribution (from xsrc, etc.) is + <p><code class="varname">X11BASE</code> is where + the actual X11 distribution (from xsrc, etc.) is installed. When looking for <span class= "emphasis"><em>standard</em></span> X11 includes (not those installed by a pkg), use @@ -6720,101 +6827,104 @@ CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} <li> <p>X11 based are special in that they may be - installed in either <tt class= - "varname">X11BASE</tt> or <tt class= - "varname">LOCALBASE</tt>.</p> + installed in either <code class= + "varname">X11BASE</code> or <code class= + "varname">LOCALBASE</code>.</p> <p>Usually, X11 packages should be installed under - <tt class="varname">LOCALBASE</tt> whenever - possible. Note that you will need to set <tt class= - "varname">USE_X11</tt> in them to request the - presence of X11 and to get the right compilation - flags.</p> + <code class="varname">LOCALBASE</code> whenever + possible. Note that you will need to set + <code class="varname">USE_X11</code> in them to + request the presence of X11 and to get the right + compilation flags.</p> <p>Even though, there are some packages that cannot - be installed under <tt class= - "varname">LOCALBASE</tt>: those that come with + be installed under <code class= + "varname">LOCALBASE</code>: those that come with app-defaults files. These packages are special and - they must be placed under <tt class= - "varname">X11BASE</tt>. To accomplish this, set - either <tt class="varname">USE_X11BASE</tt> or - <tt class="varname">USE_IMAKE</tt> in your + they must be placed under <code class= + "varname">X11BASE</code>. To accomplish this, set + either <code class="varname">USE_X11BASE</code> or + <code class="varname">USE_IMAKE</code> in your package.</p> - <p>Some notes: <tt class="varname">USE_X11</tt> and - <tt class="varname">USE_X11BASE</tt> are mutually - exclusive. If you need to find includes or - libraries installed by a pkg that has <tt class= - "varname">USE_IMAKE</tt> or <tt class= - "varname">USE_X11BASE</tt> in its pkg <tt class= - "filename">Makefile</tt>, you need to use - <span class="emphasis"><em>both</em></span> - <tt class="filename">${X11BASE}</tt> and <tt class= - "filename">${LOCALBASE}</tt>. To force installation - of all X11 packages in <tt class= - "varname">LOCALBASE</tt>, the <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= + <p>Some notes: <code class="varname">USE_X11</code> + and <code class="varname">USE_X11BASE</code> are + mutually exclusive. If you need to find includes or + libraries installed by a pkg that has <code class= + "varname">USE_IMAKE</code> or <code class= + "varname">USE_X11BASE</code> in its pkg + <code class="filename">Makefile</code>, you need to + use <span class="emphasis"><em>both</em></span> + <code class="filename">${X11BASE}</code> and + <code class="filename">${LOCALBASE}</code>. To + force installation of all X11 packages in + <code class="varname">LOCALBASE</code>, the + <a xmlns="http://www.w3.org/TR/xhtml1/transitional" + href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/xpkgwedge/README.html" - class="pkgname">pkgtools/xpkgwedge</a> is - enabled by default.</p> + class="pkgname">pkgtools/xpkgwedge</a> is enabled + by default.</p> </li> <li> - <p><tt class="varname">X11PREFIX</tt> should be + <p><code class="varname">X11PREFIX</code> should be used to refer to the installed location of an X11 - package. <tt class="varname">X11PREFIX</tt> will be - set to <tt class="varname">X11BASE</tt> if - xpkgwedge is not installed, and to <tt class= - "varname">LOCALBASE</tt> if xpkgwedge is + package. <code class="varname">X11PREFIX</code> + will be set to <code class="varname">X11BASE</code> + if xpkgwedge is not installed, and to <code class= + "varname">LOCALBASE</code> if xpkgwedge is installed.</p> </li> <li> <p>If xpkgwedge is installed, it is possible to - have some packages installed in <tt class= - "varname">X11BASE</tt> and some in <tt class= - "varname">LOCALBASE</tt>. To determine the prefix - of an installed package, the <tt class= - "varname">EVAL_PREFIX</tt> definition can be used. - It takes pairs in the format “<span class= + have some packages installed in <code class= + "varname">X11BASE</code> and some in <code class= + "varname">LOCALBASE</code>. To determine the prefix + of an installed package, the <code class= + "varname">EVAL_PREFIX</code> definition can be + used. It takes pairs in the format + “<span class= "quote">DIRNAME=<package></span>”, and - the make(1) variable <tt class= - "varname">DIRNAME</tt> will be set to the prefix of - the installed package <package>, or + the make(1) variable <code class= + "varname">DIRNAME</code> will be set to the prefix + of the installed package <package>, or “<span class= "quote">${X11PREFIX}</span>” if the package is not installed.</p> <p>This is best illustrated by example.</p> - <p>The following lines are taken from <tt class= - "filename">pkgsrc/wm/scwm/Makefile</tt>:</p> + <p>The following lines are taken from <code class= + "filename">pkgsrc/wm/scwm/Makefile</code>:</p> <pre class="programlisting"> -EVAL_PREFIX+= GTKDIR=gtk+ +EVAL_PREFIX+= GTKDIR=gtk+ CONFIGURE_ARGS+= --with-guile-prefix=${LOCALBASE} \ --with-gtk-prefix="${GTKDIR}" \ --enable-multibyte </pre> <p>Specific defaults can be defined for the - packages evaluated using <tt class= - "varname">EVAL_PREFIX</tt>, by using a definition + packages evaluated using <code class= + "varname">EVAL_PREFIX</code>, by using a definition of the form:</p> <pre class="programlisting"> GTKDIR_DEFAULT= ${LOCALBASE} </pre> - <p>where <tt class="varname">GTKDIR</tt> + <p>where <code class="varname">GTKDIR</code> corresponds to the first definition in the - <tt class="varname">EVAL_PREFIX</tt> pair.</p> + <code class="varname">EVAL_PREFIX</code> pair.</p> </li> <li> - <p>Within <tt class="filename">${PREFIX}</tt>, + <p>Within <code class="filename">${PREFIX}</code>, packages should install files according to hier(7), with the exception that manual pages go into - <tt class="filename">${PREFIX}/man</tt>, not - <tt class="filename">${PREFIX}/share/man</tt>.</p> + <code class="filename">${PREFIX}/man</code>, not + <code class= + "filename">${PREFIX}/share/man</code>.</p> </li> </ul> </div> @@ -6825,14 +6935,14 @@ GTKDIR_DEFAULT= ${LOCALBASE} <div> <div> <h2 class="title" style="clear: both"><a name= - "id2569330" id="id2569330"></a>11.2. Main + "id2589198" id="id2589198"></a>11.2. Main targets</h2> </div> </div> </div> <p>The main targets used during the build process defined - in <tt class="filename">bsd.pkg.mk</tt> are:</p> + in <code class="filename">bsd.pkg.mk</code> are:</p> <div class="variablelist"> <dl> @@ -6840,30 +6950,30 @@ GTKDIR_DEFAULT= ${LOCALBASE} <dd> <p>This will check if the file(s) given in the - variables <tt class="varname">DISTFILES</tt> and - <tt class="varname">PATCHFILES</tt> (as defined in - the package's Makefile) are present on the local - system in <tt class= - "filename">/usr/pkgsrc/distfiles</tt>. If they are - not present, an attempt will be made to fetch them - using commands of the form:</p> + variables <code class="varname">DISTFILES</code> + and <code class="varname">PATCHFILES</code> (as + defined in the package's Makefile) are present on + the local system in <code class= + "filename">/usr/pkgsrc/distfiles</code>. If they + are not present, an attempt will be made to fetch + them using commands of the form:</p> <pre class="programlisting"> ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} </pre> <p>where ${site} varies through several - possibilities in turn: first, <tt class= - "varname">MASTER_SITE_OVERRIDE</tt> is tried, then - the sites specified in either <tt class= - "varname">SITES_file</tt> if defined, else - <tt class="varname">MASTER_SITES</tt> or <tt class= - "varname">PATCH_SITES</tt>, as applies, then - finally the value of <tt class= - "varname">MASTER_SITE_BACKUP</tt>. The order of all - except the first can be optionally sorted by the - user, via setting either <tt class= - "varname">MASTER_SORT_AWK</tt> or <tt class= - "varname">MASTER_SORT_REGEX</tt>.</p> + possibilities in turn: first, <code class= + "varname">MASTER_SITE_OVERRIDE</code> is tried, + then the sites specified in either <code class= + "varname">SITES_file</code> if defined, else + <code class="varname">MASTER_SITES</code> or + <code class="varname">PATCH_SITES</code>, as + applies, then finally the value of <code class= + "varname">MASTER_SITE_BACKUP</code>. The order of + all except the first can be optionally sorted by + the user, via setting either <code class= + "varname">MASTER_SORT_AWK</code> or <code class= + "varname">MASTER_SORT_REGEX</code>.</p> </dd> <dt><span class="term">checksum</span></dt> @@ -6886,41 +6996,42 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} <p>When the distfiles are present on the local system, they need to be extracted, as they are usually in the form of some compressed archive - format, most commonly <tt class= - "filename">.tar.gz</tt>.</p> + format, most commonly <code class= + "filename">.tar.gz</code>.</p> <p>If only some of the distfiles need to be uncompressed, the files to be uncompressed should - be put into <tt class= - "varname">EXTRACT_ONLY</tt>.</p> - - <p>If the distfiles are not in <tt class= - "filename">.tar.gz</tt> format, they can be - extracted by setting either <tt class= - "varname">EXTRACT_SUFX</tt>, or <tt class= - "varname">EXTRACT_CMD</tt>, <tt class= - "varname">EXTRACT_BEFORE_ARGS</tt> and <tt class= - "varname">EXTRACT_AFTER_ARGS</tt>. In the former - case, pkgsrc knows how to extract a number of - suffixes (<tt class="filename">.tar.gz</tt>, - <tt class="filename">.tgz</tt>, <tt class= - "filename">.tar.gz2</tt>, <tt class= - "filename">.tbz</tt>, <tt class= - "filename">.tar.Z</tt>, <tt class= - "filename">.tar</tt>, <tt class= - "filename">.shar.gz</tt>, <tt class= - "filename">.shar.bz2</tt>, <tt class= - "filename">.shar.Z</tt>, <tt class= - "filename">.shar</tt>, <tt class= - "filename">.Z</tt>, <tt class="filename">.bz2</tt> - and <tt class="filename">.gz</tt>; see the - definition of the various <tt class= - "varname">DECOMPRESS_CMD</tt> variables <tt class= - "filename">bsd.pkg.mk</tt> for a complete list). - Here's an example on how to use the other variables - for a program that comes with a compressed shell - archive whose name ends in <tt class= - "filename">.msg.gz</tt>:</p> + be put into <code class= + "varname">EXTRACT_ONLY</code>.</p> + + <p>If the distfiles are not in <code class= + "filename">.tar.gz</code> format, they can be + extracted by setting either <code class= + "varname">EXTRACT_SUFX</code>, or <code class= + "varname">EXTRACT_CMD</code>, <code class= + "varname">EXTRACT_BEFORE_ARGS</code> and + <code class="varname">EXTRACT_AFTER_ARGS</code>. In + the former case, pkgsrc knows how to extract a + number of suffixes (<code class= + "filename">.tar.gz</code>, <code class= + "filename">.tgz</code>, <code class= + "filename">.tar.gz2</code>, <code class= + "filename">.tbz</code>, <code class= + "filename">.tar.Z</code>, <code class= + "filename">.tar</code>, <code class= + "filename">.shar.gz</code>, <code class= + "filename">.shar.bz2</code>, <code class= + "filename">.shar.Z</code>, <code class= + "filename">.shar</code>, <code class= + "filename">.Z</code>, <code class= + "filename">.bz2</code> and <code class= + "filename">.gz</code>; see the definition of the + various <code class="varname">DECOMPRESS_CMD</code> + variables <code class="filename">bsd.pkg.mk</code> + for a complete list). Here's an example on how to + use the other variables for a program that comes + with a compressed shell archive whose name ends in + <code class="filename">.msg.gz</code>:</p> <pre class="programlisting"> EXTRACT_SUFX= .msg.gz EXTRACT_CMD= zcat @@ -6933,18 +7044,20 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} <dd> <p>After extraction, all the patches named by the - <tt class="varname">PATCHFILES</tt>, those present - in the patches subdirectory of the package as well - as in $LOCALPATCHES/$PKGPATH (e.g. <tt class= - "filename">/usr/local/patches/graphics/png</tt>) - are applied. Patchfiles ending in <tt class= - "filename">.Z</tt> or <tt class="filename">.gz</tt> - are uncompressed before they are applied, files - ending in <tt class="filename">.orig</tt> or - <tt class="filename">.rej</tt> are ignored. Any - special options to patch(1) can be handed in - <tt class="varname">PATCH_DIST_ARGS</tt>. See - <a href="#components.patches" title= + <code class="varname">PATCHFILES</code>, those + present in the patches subdirectory of the package + as well as in $LOCALPATCHES/$PKGPATH (e.g. + <code class= + "filename">/usr/local/patches/graphics/png</code>) + are applied. Patchfiles ending in <code class= + "filename">.Z</code> or <code class= + "filename">.gz</code> are uncompressed before they + are applied, files ending in <code class= + "filename">.orig</code> or <code class= + "filename">.rej</code> are ignored. Any special + options to patch(1) can be handed in <code class= + "varname">PATCH_DIST_ARGS</code>. See <a href= + "#components.patches" title= "7.3. patches/*">Section 7.3, “patches/*”</a> for more details.</p> @@ -6970,20 +7083,21 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} <p>If the program's distfile contains its own configure script, this can be invoked by setting - <tt class="varname">HAS_CONFIGURE</tt>. If the + <code class="varname">HAS_CONFIGURE</code>. If the configure script is a GNU autoconf script, - <tt class="varname">GNU_CONFIGURE</tt> should be - specified instead. In either case, any arguments to - the configure script can be specified in the - <tt class="varname">CONFIGURE_ARGS</tt> variable, - and the configure script's name can be set in - <tt class="varname">CONFIGURE_SCRIPT</tt> if it - differs from the default “<span class= + <code class="varname">GNU_CONFIGURE</code> should + be specified instead. In either case, any arguments + to the configure script can be specified in the + <code class="varname">CONFIGURE_ARGS</code> + variable, and the configure script's name can be + set in <code class= + "varname">CONFIGURE_SCRIPT</code> if it differs + from the default “<span class= "quote">configure</span>”. Here's an example from the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/sysutils/top/README.html" - class="pkgname">sysutils/top</a> package:</p> + class="pkgname">sysutils/top</a> package:</p> <pre class="programlisting"> HAS_CONFIGURE= yes CONFIGURE_SCRIPT= Configure @@ -6992,30 +7106,32 @@ CONFIGURE_ARGS+= netbsd13 <p>If the program uses an Imakefile for configuration, the appropriate steps can be invoked - by setting <tt class="varname">USE_IMAKE</tt> to - “<span class="quote">YES</span>”. (If - you only want the package installed in <tt class= - "varname">$X11PREFIX</tt> but xmkmf not being run, - set <tt class="varname">USE_X11BASE</tt> - instead!)</p> + by setting <code class="varname">USE_IMAKE</code> + to “<span class="quote">YES</span>”. + (If you only want the package installed in + <code class="varname">$X11PREFIX</code> but xmkmf + not being run, set <code class= + "varname">USE_X11BASE</code> instead!)</p> </dd> <dt><span class="term">build</span></dt> <dd> <p>Once configuration has taken place, the software - will be built by invoking <tt class= - "varname">$MAKE_PROGRAM</tt> on <tt class= - "varname">$MAKEFILE</tt> with <tt class= - "varname">$ALL_TARGET</tt> as the target to build. - The default <tt class="varname">MAKE_PROGRAM</tt> - is “<span class="quote">gmake</span>” - if <tt class="varname">USE_GMAKE</tt> is set, + will be built by invoking <code class= + "varname">$MAKE_PROGRAM</code> on <code class= + "varname">$MAKEFILE</code> with <code class= + "varname">$ALL_TARGET</code> as the target to + build. The default <code class= + "varname">MAKE_PROGRAM</code> is + “<span class="quote">gmake</span>” if + <code class="varname">USE_GNU_TOOLS</code> contains + “<span class="quote">make</span>”, “<span class="quote">make</span>” - otherwise. <tt class="varname">MAKEFILE</tt> is set - to “<span class= + otherwise. <code class="varname">MAKEFILE</code> is + set to “<span class= "quote">Makefile</span>” by default, and - <tt class="varname">ALL_TARGET</tt> defaults to + <code class="varname">ALL_TARGET</code> defaults to “<span class="quote">all</span>”. Any of these variables can be set in the package's Makefile to change the default build process.</p> @@ -7027,15 +7143,16 @@ CONFIGURE_ARGS+= netbsd13 <p>Once the build stage has completed, the final step is to install the software in public directories, so users can access the programs and - files. As in the build-target, <tt class= - "varname">$MAKE_PROGRAM</tt> is invoked on - <tt class="varname">$MAKEFILE</tt> here, but with - the <tt class="varname">$INSTALL_TARGET</tt> - instead, the latter defaulting to - “<span class="quote">install</span>” - (plus “<span class= - "quote">install.man</span>”, if <tt class= - "varname">USE_IMAKE</tt> is set).</p> + files. As in the build-target, <code class= + "varname">$MAKE_PROGRAM</code> is invoked on + <code class="varname">$MAKEFILE</code> here, but + with the <code class= + "varname">$INSTALL_TARGET</code> instead, the + latter defaulting to “<span class= + "quote">install</span>” (plus + “<span class= + "quote">install.man</span>”, if <code class= + "varname">USE_IMAKE</code> is set).</p> </dd> </dl> </div> @@ -7043,8 +7160,9 @@ CONFIGURE_ARGS+= netbsd13 <p>If no target is specified, the default is “<span class="quote">build</span>”. If a subsequent stage is requested, all prior stages are made: - e.g. <span><b class="command">make build</b></span> will - also perform the equivalent of:</p> + e.g. <span><strong class="command">make + build</strong></span> will also perform the equivalent + of:</p> <pre class="programlisting"> make fetch make checksum @@ -7099,9 +7217,9 @@ make build <dt><span class="term">reinstall</span></dt> <dd> - <p>If you did a <span><b class="command">make - install</b></span> and you noticed some file was - not installed properly, you can repeat the + <p>If you did a <span><strong class="command">make + install</strong></span> and you noticed some file + was not installed properly, you can repeat the installation with this target, which will ignore the “<span class="quote">already installed</span>” flag.</p> @@ -7117,8 +7235,8 @@ make build <div class="variablelist"> <dl> - <dt><span class="term"><tt class= - "varname">PKG_VERBOSE</tt></span></dt> + <dt><span class="term"><code class= + "varname">PKG_VERBOSE</code></span></dt> <dd> <p>Add a "-v" to the <a href= @@ -7128,17 +7246,17 @@ make build command.</p> </dd> - <dt><span class="term"><tt class= - "varname">DEINSTALLDEPENDS</tt></span></dt> + <dt><span class="term"><code class= + "varname">DEINSTALLDEPENDS</code></span></dt> <dd> <p>Remove all packages that require (depend on) the given package. This can be used to remove any packages that may have been pulled in by a given package, e.g. if - <span><b class="command">make deinstall - DEINSTALLDEPENDS=1</b></span> is done in - <tt class="filename">pkgsrc/x11/kde</tt>, + <span><strong class="command">make deinstall + DEINSTALLDEPENDS=1</strong></span> is done in + <code class="filename">pkgsrc/x11/kde</code>, this is likely to remove whole KDE. Works by adding “<span class= "quote">-R</span>” to the <a href= @@ -7160,59 +7278,62 @@ make build current versions of the corresponding packages get compiled and installed. This is similar to manually noting which packages are currently installed, then - performing a series of <span><b class= - "command">make deinstall</b></span> and - <span><b class="command">make install</b></span> - (or whatever <tt class="varname">UPDATE_TARGET</tt> - is set to) for these packages.</p> + performing a series of <span><strong class= + "command">make deinstall</strong></span> and + <span><strong class="command">make + install</strong></span> (or whatever <code class= + "varname">UPDATE_TARGET</code> is set to) for these + packages.</p> <p>You can use the “<span class= "quote">update</span>” target to resume - package updating in case a previous <span><b class= - "command">make update</b></span> was interrupted - for some reason. However, in this case, make sure - you don't call <span><b class="command">make - clean</b></span> or otherwise remove the list of - dependent packages in <tt class= - "varname">WRKDIR</tt>. Otherwise you lose the + package updating in case a previous + <span><strong class="command">make + update</strong></span> was interrupted for some + reason. However, in this case, make sure you don't + call <span><strong class="command">make + clean</strong></span> or otherwise remove the list + of dependent packages in <code class= + "varname">WRKDIR</code>. Otherwise you lose the ability to automatically update the current package along with the dependent packages you have installed.</p> - <p>Resuming an interrupted <span><b class= - "command">make update</b></span> will only work as - long as the package tree remains unchanged. If the - source code for one of the packages to be updated - has been changed, resuming <span><b class= - "command">make update</b></span> will most - certainly fail!</p> + <p>Resuming an interrupted <span><strong class= + "command">make update</strong></span> will only + work as long as the package tree remains unchanged. + If the source code for one of the packages to be + updated has been changed, resuming + <span><strong class="command">make + update</strong></span> will most certainly + fail!</p> <p>The following variables can be used either on - the command line or in <tt class= - "filename">/etc/mk.conf</tt> to alter the behaviour - of <span><b class="command">make - update</b></span>:</p> + the command line or in <code class= + "filename">/etc/mk.conf</code> to alter the + behaviour of <span><strong class="command">make + update</strong></span>:</p> <div class="variablelist"> <dl> - <dt><span class="term"><tt class= - "varname">UPDATE_TARGET</tt></span></dt> + <dt><span class="term"><code class= + "varname">UPDATE_TARGET</code></span></dt> <dd> <p>Install target to recursively use for the updated package and the dependent packages. - Defaults to <tt class= - "varname">DEPENDS_TARGET</tt> if set, + Defaults to <code class= + "varname">DEPENDS_TARGET</code> if set, “<span class= "quote">install</span>” otherwise for - <span><b class="command">make - update</b></span>. e.g. <span><b class= - "command">make update - UPDATE_TARGET=package</b></span></p> + <span><strong class="command">make + update</strong></span>. e.g. + <span><strong class="command">make update + UPDATE_TARGET=package</strong></span></p> </dd> - <dt><span class="term"><tt class= - "varname">NOCLEAN</tt></span></dt> + <dt><span class="term"><code class= + "varname">NOCLEAN</code></span></dt> <dd> <p>Don't clean up after updating. Useful if @@ -7224,27 +7345,28 @@ make build "quote">clean-update</span>” target below) or you may run into troubles with old source code still lying around on your next - <span><b class="command">make</b></span> or - <span><b class="command">make - update</b></span>.</p> + <span><strong class= + "command">make</strong></span> or + <span><strong class="command">make + update</strong></span>.</p> </dd> - <dt><span class="term"><tt class= - "varname">REINSTALL</tt></span></dt> + <dt><span class="term"><code class= + "varname">REINSTALL</code></span></dt> <dd> <p>Deinstall each package before installing - (making <tt class= - "varname">DEPENDS_TARGET</tt>). This may be + (making <code class= + "varname">DEPENDS_TARGET</code>). This may be necessary if the “<span class= "quote">clean-update</span>” target (see below) was called after interrupting a - running <span><b class="command">make - update</b></span>.</p> + running <span><strong class="command">make + update</strong></span>.</p> </dd> - <dt><span class="term"><tt class= - "varname">DEPENDS_TARGET</tt></span></dt> + <dt><span class="term"><code class= + "varname">DEPENDS_TARGET</code></span></dt> <dd> <p>Allows you to disable recursion and @@ -7252,14 +7374,14 @@ make build is “<span class= "quote">update</span>” for the update target, facilitating a recursive update of - prerequisite packages. Only set <tt class= - "varname">DEPENDS_TARGET</tt> if you want to - disable recursive updates. Use <tt class= - "varname">UPDATE_TARGET</tt> instead to just - set a specific target for each package to be - installed during <span><b class= - "command">make update</b></span> (see - above).</p> + prerequisite packages. Only set <code class= + "varname">DEPENDS_TARGET</code> if you want + to disable recursive updates. Use + <code class="varname">UPDATE_TARGET</code> + instead to just set a specific target for + each package to be installed during + <span><strong class="command">make + update</strong></span> (see above).</p> </dd> </dl> </div> @@ -7269,62 +7391,65 @@ make build <dd> <p>Clean the source tree for all packages that - would get updated if <span><b class="command">make - update</b></span> was called from the current - directory. This target should not be used if the - current package (or any of its depending packages) - have already been de-installed (e.g., after calling - <span><b class="command">make update</b></span>) or - you may lose some packages you intended to update. - As a rule of thumb: only use this target - <span class="emphasis"><em>before</em></span> the - first time you run <span><b class="command">make - update</b></span> and only if you have a dirty - package tree (e.g., if you used <tt class= - "varname">NOCLEAN</tt>).</p> + would get updated if <span><strong class= + "command">make update</strong></span> was called + from the current directory. This target should not + be used if the current package (or any of its + depending packages) have already been de-installed + (e.g., after calling <span><strong class= + "command">make update</strong></span>) or you may + lose some packages you intended to update. As a + rule of thumb: only use this target <span class= + "emphasis"><em>before</em></span> the first time + you run <span><strong class="command">make + update</strong></span> and only if you have a dirty + package tree (e.g., if you used <code class= + "varname">NOCLEAN</code>).</p> <p>If you unsure about whether your tree is clean - you can either perform a <span><b class= - "command">make clean</b></span> at the top of the - tree, or use the following sequence of commands + you can either perform a <span><strong class= + "command">make clean</strong></span> at the top of + the tree, or use the following sequence of commands from the directory of the package you want to update (<span class= "emphasis"><em>before</em></span> running - <span><b class="command">make update</b></span> for - the first time, otherwise you lose all the packages - you wanted to update!):</p> + <span><strong class="command">make + update</strong></span> for the first time, + otherwise you lose all the packages you wanted to + update!):</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make clean-update</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make clean CLEANDEPENDS=YES</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make update</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make clean-update</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>make clean CLEANDEPENDS=YES</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>make update</code></strong> </pre> <p>The following variables can be used either on - the command line or in <tt class= - "filename">/etc/mk.conf</tt> to alter the behaviour - of <span><b class="command">make - clean-update</b></span>:</p> + the command line or in <code class= + "filename">/etc/mk.conf</code> to alter the + behaviour of <span><strong class="command">make + clean-update</strong></span>:</p> <div class="variablelist"> <dl> - <dt><span class="term"><tt class= - "varname">CLEAR_DIRLIST</tt></span></dt> + <dt><span class="term"><code class= + "varname">CLEAR_DIRLIST</code></span></dt> <dd> - <p>After <span><b class="command">make - clean</b></span>, do not reconstruct the list - of directories to update for this package. - Only use this if <span><b class= - "command">make update</b></span> successfully - installed all packages you wanted to update. - Normally, this is done automatically on - <span><b class="command">make - update</b></span>, but may have been - suppressed by the <tt class= - "varname">NOCLEAN</tt> variable (see + <p>After <span><strong class="command">make + clean</strong></span>, do not reconstruct the + list of directories to update for this + package. Only use this if + <span><strong class="command">make + update</strong></span> successfully installed + all packages you wanted to update. Normally, + this is done automatically on + <span><strong class="command">make + update</strong></span>, but may have been + suppressed by the <code class= + "varname">NOCLEAN</code> variable (see above).</p> </dd> </dl> @@ -7345,47 +7470,48 @@ make build <dt><span class="term">readme</span></dt> <dd> - <p>This target generates a <tt class= - "filename">README.html</tt> file, which can be + <p>This target generates a <code class= + "filename">README.html</code> file, which can be viewed using a browser such as <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/mozilla/README.html" - class="pkgname">www/mozilla</a> or <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/links/README.html" - class="pkgname">www/links</a>. The generated - files contain references to any packages which - are in the <tt class="varname">PACKAGES</tt> - directory on the local host. The generated files - can be made to refer to URLs based on <tt class= - "varname">FTP_PKG_URL_HOST</tt> and <tt class= - "varname">FTP_PKG_URL_DIR</tt>. For example, if - I wanted to generate <tt class= - "filename">README.html</tt> files which pointed - to binary packages on the local machine, in the - directory <tt class= - "filename">/usr/packages</tt>, set <tt class= - "varname">FTP_PKG_URL_HOST=file://localhost</tt> - and <tt class= - "varname">FTP_PKG_URL_DIR=/usr/packages</tt>. - The <tt class="varname">${PACKAGES}</tt> - directory and its subdirectories will be - searched for all the binary packages.</p> + class="pkgname">www/mozilla</a> or <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/links/README.html" + class="pkgname">www/links</a>. The generated files + contain references to any packages which are in the + <code class="varname">PACKAGES</code> directory on + the local host. The generated files can be made to + refer to URLs based on <code class= + "varname">FTP_PKG_URL_HOST</code> and <code class= + "varname">FTP_PKG_URL_DIR</code>. For example, if I + wanted to generate <code class= + "filename">README.html</code> files which pointed + to binary packages on the local machine, in the + directory <code class= + "filename">/usr/packages</code>, set <code class= + "varname">FTP_PKG_URL_HOST=file://localhost</code> + and <code class= + "varname">FTP_PKG_URL_DIR=/usr/packages</code>. The + <code class="varname">${PACKAGES}</code> directory + and its subdirectories will be searched for all the + binary packages.</p> </dd> <dt><span class="term">readme-all</span></dt> <dd> - <p>Use this target to create a file <tt class= - "filename">README-all.html</tt> which contains a + <p>Use this target to create a file <code class= + "filename">README-all.html</code> which contains a list of all packages currently available in the NetBSD Packages Collection, together with the category they belong to and a short description. - This file is compiled from the <tt class= - "filename">pkgsrc/*/README.html</tt> files, so be + This file is compiled from the <code class= + "filename">pkgsrc/*/README.html</code> files, so be sure to run this <span class= - "emphasis"><em>after</em></span> a <span><b class= - "command">make readme</b></span>.</p> + "emphasis"><em>after</em></span> a + <span><strong class="command">make + readme</strong></span>.</p> </dd> <dt><span class="term">cdrom-readme</span></dt> @@ -7395,21 +7521,21 @@ make build “<span class="quote">readme</span>” target (see above), but is to be used when generating a pkgsrc tree to be written to a CD-ROM. - This target also produces <tt class= - "filename">README.html</tt> files, and can be made - to refer to URLs based on <tt class= - "varname">CDROM_PKG_URL_HOST</tt> and <tt class= - "varname">CDROM_PKG_URL_DIR</tt>.</p> + This target also produces <code class= + "filename">README.html</code> files, and can be + made to refer to URLs based on <code class= + "varname">CDROM_PKG_URL_HOST</code> and + <code class="varname">CDROM_PKG_URL_DIR</code>.</p> </dd> <dt><span class="term">show-distfiles</span></dt> <dd> <p>This target shows which distfiles and patchfiles - are needed to build the package. (<tt class= - "varname">DISTFILES</tt> and <tt class= - "varname">PATCHFILES</tt>, but not <tt class= - "filename">patches/*</tt>)</p> + are needed to build the package. (<code class= + "varname">DISTFILES</code> and <code class= + "varname">PATCHFILES</code>, but not <code class= + "filename">patches/*</code>)</p> </dd> <dt><span class="term">show-downlevel</span></dt> @@ -7445,8 +7571,8 @@ make build <dd> <p>This target shows which installed packages match - the current package's <tt class= - "varname">DEPENDS</tt>. Useful if out of date + the current package's <code class= + "varname">DEPENDS</code>. Useful if out of date dependencies are causing build problems.</p> </dd> @@ -7456,9 +7582,9 @@ make build <p>After a package is installed, check all its binaries and (on ELF platforms) shared libraries to see if they find the shared libs they need. Run by - default if <tt class="varname">PKG_DEVELOPER</tt> - is set in <tt class= - "filename">/etc/mk.conf</tt>.</p> + default if <code class= + "varname">PKG_DEVELOPER</code> is set in + <code class="filename">/etc/mk.conf</code>.</p> </dd> <dt><span class="term">print-PLIST</span></dt> @@ -7467,30 +7593,31 @@ make build <p>After a “<span class="quote">make install</span>” from a new or upgraded pkg, this prints out an attempt to generate a new - <tt class="filename">PLIST</tt> from a - <span><b class="command">find -newer - work/.extract_done</b></span>. An attempt is made - to care for shared libs etc., but it is + <code class="filename">PLIST</code> from a + <span><strong class="command">find -newer + work/.extract_done</strong></span>. An attempt is + made to care for shared libs etc., but it is <span class="emphasis"><em>strongly</em></span> recommended to review the result before putting it - into <tt class="filename">PLIST</tt>. On upgrades, - it's useful to diff the output of this command - against an already existing <tt class= - "filename">PLIST</tt> file.</p> + into <code class="filename">PLIST</code>. On + upgrades, it's useful to diff the output of this + command against an already existing <code class= + "filename">PLIST</code> file.</p> <p>If the package installs files via tar(1) or other methods that don't update file access times, be sure to add these files manually to your - <tt class="filename">PLIST</tt>, as the + <code class="filename">PLIST</code>, as the “<span class="quote">find -newer</span>” command used by this target won't catch them!</p> <p>See <a href="#print-PLIST" title= "8.3. Tweaking output of make print-PLIST">Section 8.3, - “Tweaking output of make - print-PLIST”</a> for more information on this - target.</p> + “Tweaking output of <span><strong class= + "command">make + print-PLIST</strong></span>”</a> for more + information on this target.</p> </dd> <dt><span class="term">bulk-package</span></dt> @@ -7499,8 +7626,8 @@ make build <p>Used to do bulk builds. If an appropriate binary package already exists, no action is taken. If not, this target will compile, install and package it - (and it's depends, if <tt class= - "varname">PKG_DEPENDS</tt> is set properly. See + (and it's depends, if <code class= + "varname">PKG_DEPENDS</code> is set properly. See <a href="#binary.configuration" title= "5.3.1. Configuration">Section 5.3.1, “Configuration”</a>. After creating the @@ -7522,9 +7649,9 @@ make build "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">pkg_add</span>(1)</span></a>. If - not, <span><b class="command">make - bulk-package</b></span> will be executed, but the - installed binary not be removed.</p> + not, <span><strong class="command">make + bulk-package</strong></span> will be executed, but + the installed binary not be removed.</p> <p>A binary package is considered “<span class="quote">upto-date</span>” @@ -7537,9 +7664,9 @@ make build <div class="itemizedlist"> <ul type="disc"> <li> - <p>None of the package's files (<tt class= - "filename">Makefile</tt>, ...) were modified - since it was built.</p> + <p>None of the package's files (<code class= + "filename">Makefile</code>, ...) were + modified since it was built.</p> </li> <li> @@ -7574,17 +7701,17 @@ make build <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2570795">12.1. + <dt><span class="sect1"><a href="#id2590531">12.1. General operation</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2570798">12.1.1. How to pull in variables from + "#id2590534">12.1.1. How to pull in variables from /etc/mk.conf</a></span></dt> <dt><span class="sect2"><a href= - "#id2570882">12.1.2. Restricted + "#id2590685">12.1.2. Restricted packages</a></span></dt> <dt><span class="sect2"><a href= @@ -7592,15 +7719,15 @@ make build dependencies</a></span></dt> <dt><span class="sect2"><a href= - "#id2571260">12.1.4. Handling conflicts with other + "#id2591201">12.1.4. Handling conflicts with other packages</a></span></dt> <dt><span class="sect2"><a href= - "#id2571447">12.1.5. Packages that cannot or should + "#id2591251">12.1.5. Packages that cannot or should not be built</a></span></dt> <dt><span class="sect2"><a href= - "#id2571473">12.1.6. Packages which should not be + "#id2591413">12.1.6. Packages which should not be deleted, once installed</a></span></dt> <dt><span class="sect2"><a href= @@ -7608,37 +7735,37 @@ make build security problems</a></span></dt> <dt><span class="sect2"><a href= - "#id2571564">12.1.8. How to handle compiler + "#id2591505">12.1.8. How to handle compiler bugs</a></span></dt> <dt><span class="sect2"><a href= - "#id2571587">12.1.9. How to handle incrementing + "#id2591527">12.1.9. How to handle incrementing versions when fixing an existing package</a></span></dt> <dt><span class="sect2"><a href= - "#id2571704">12.1.10. Portability of + "#id2591644">12.1.10. Portability of packages</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2571729">12.2. + <dt><span class="sect1"><a href="#id2591669">12.2. Possible downloading issues</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2571732">12.2.1. Packages whose distfiles + "#id2591672">12.2.1. Packages whose distfiles aren't available for plain downloading</a></span></dt> <dt><span class="sect2"><a href= - "#id2571795">12.2.2. How to handle modified + "#id2591735">12.2.2. How to handle modified distfiles with the 'old' name</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2571806">12.3. + <dt><span class="sect1"><a href="#id2591747">12.3. Configuration gotchas</a></span></dt> <dd> @@ -7648,64 +7775,64 @@ make build libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2572350">12.3.2. Using libtool on GNU packages + "#id2592086">12.3.2. Using libtool on GNU packages that already support libtool</a></span></dt> <dt><span class="sect2"><a href= - "#id2572435">12.3.3. GNU + "#id2592238">12.3.3. GNU Autoconf/Automake</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2572480">12.4. + <dt><span class="sect1"><a href="#id2592283">12.4. Building considerations</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2572483">12.4.1. CPP defines</a></span></dt> + "#id2592286">12.4.1. CPP defines</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2572513">12.5. + <dt><span class="sect1"><a href="#id2592316">12.5. Package specific actions</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#id2572516">12.5.1. Package configuration + "#id2592320">12.5.1. Package configuration files</a></span></dt> <dt><span class="sect2"><a href= - "#id2572618">12.5.2. User + "#id2592490">12.5.2. User interaction</a></span></dt> <dt><span class="sect2"><a href= - "#id2572663">12.5.3. Handling + "#id2592535">12.5.3. Handling licenses</a></span></dt> <dt><span class="sect2"><a href= - "#id2572746">12.5.4. Creating an account from a + "#id2592686">12.5.4. Creating an account from a package</a></span></dt> <dt><span class="sect2"><a href= - "#id2572876">12.5.5. Installing score + "#id2592748">12.5.5. Installing score files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573057">12.5.6. Packages providing login + "#id2592929">12.5.6. Packages providing login shells</a></span></dt> <dt><span class="sect2"><a href= - "#id2573182">12.5.7. Packages containing perl + "#id2593054">12.5.7. Packages containing perl scripts</a></span></dt> <dt><span class="sect2"><a href= - "#id2573201">12.5.8. Packages with hardcoded paths + "#id2593073">12.5.8. Packages with hardcoded paths to other interpreters</a></span></dt> <dt><span class="sect2"><a href= - "#id2573222">12.5.9. Packages installing perl + "#id2593094">12.5.9. Packages installing perl modules</a></span></dt> <dt><span class="sect2"><a href= @@ -7713,36 +7840,36 @@ make build files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573442">12.5.11. Packages installing GConf2 + "#id2593450">12.5.11. Packages installing GConf2 data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573610">12.5.12. Packages installing + "#id2593550">12.5.12. Packages installing scrollkeeper data files</a></span></dt> <dt><span class="sect2"><a href= - "#id2573661">12.5.13. Packages installing X11 + "#id2593602">12.5.13. Packages installing X11 fonts</a></span></dt> <dt><span class="sect2"><a href= - "#id2573708">12.5.14. Packages installing GTK2 + "#id2593649">12.5.14. Packages installing GTK2 modules</a></span></dt> <dt><span class="sect2"><a href= - "#id2573778">12.5.15. Packages installing SGML or + "#id2593718">12.5.15. Packages installing SGML or XML data</a></span></dt> <dt><span class="sect2"><a href= - "#id2573830">12.5.16. Packages installing + "#id2593770">12.5.16. Packages installing extensions to the MIME database</a></span></dt> <dt><span class="sect2"><a href= - "#id2573969">12.5.17. Packages using + "#id2593841">12.5.17. Packages using intltool</a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#id2573982">12.6. + <dt><span class="sect1"><a href="#id2593854">12.6. Feedback to the author</a></span></dt> </dl> </div> @@ -7752,7 +7879,7 @@ make build <div> <div> <h2 class="title" style="clear: both"><a name= - "id2570795" id="id2570795"></a>12.1. General + "id2590531" id="id2590531"></a>12.1. General operation</h2> </div> </div> @@ -7762,34 +7889,36 @@ make build <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2570798" id= - "id2570798"></a>12.1.1. How to pull in + <h3 class="title"><a name="id2590534" id= + "id2590534"></a>12.1.1. How to pull in variables from /etc/mk.conf</h3> </div> </div> </div> <p>The problem with package-defined variables that can - be overridden via <tt class="varname">MAKECONF</tt> or - <tt class="filename">/etc/mk.conf</tt> is that <a href= + be overridden via <code class="varname">MAKECONF</code> + or <code class="filename">/etc/mk.conf</code> is that + <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> expands a variable as it is used, but evaluates preprocessor like statements (.if, .ifdef and .ifndef) as they are read. - So, to use any variable (which may be set in <tt class= - "filename">/etc/mk.conf</tt>) in one of the .if* - statements, the file <tt class= - "filename">/etc/mk.conf</tt> must be included before + So, to use any variable (which may be set in + <code class="filename">/etc/mk.conf</code>) in one of + the .if* statements, the file <code class= + "filename">/etc/mk.conf</code> must be included before that .if* statement.</p> <p>Rather than have a number of ad-hoc ways of - including <tt class="filename">/etc/mk.conf</tt>, - should it exist, or <tt class="varname">MAKECONF</tt>, - should it exist, include the <tt class= - "filename">pkgsrc/mk/bsd.prefs.mk</tt> file in the - package Makefile before any preprocessor-like .if, - .ifdef, or .ifndef statements:</p> + including <code class="filename">/etc/mk.conf</code>, + should it exist, or <code class= + "varname">MAKECONF</code>, should it exist, include the + <code class="filename">pkgsrc/mk/bsd.prefs.mk</code> + file in the package Makefile before any + preprocessor-like .if, .ifdef, or .ifndef + statements:</p> <pre class="programlisting"> .include "../../mk/bsd.prefs.mk" @@ -7798,31 +7927,31 @@ make build .endif </pre> - <p>If you wish to set the <tt class= - "varname">CFLAGS</tt> variable in <tt class= - "filename">/etc/mk.conf</tt> please make sure to + <p>If you wish to set the <code class= + "varname">CFLAGS</code> variable in <code class= + "filename">/etc/mk.conf</code> please make sure to use:</p> <pre class="programlisting"> CFLAGS+= -your -flags </pre> - <p>Using <tt class="varname">CFLAGS=</tt> (i.e. without - the “<span class="quote">+</span>”) may - lead to problems with packages that need to add their - own flags. Also, you may want to take a look at the - <a xmlns="http://www.w3.org/TR/xhtml1/transitional" + <p>Using <code class="varname">CFLAGS=</code> (i.e. + without the “<span class="quote">+</span>”) + may lead to problems with packages that need to add + their own flags. Also, you may want to take a look at + the <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/cpuflags/README.html" - class="pkgname">devel/cpuflags</a> package if you're - interested in optimization for the current CPU.</p> + class="pkgname">devel/cpuflags</a> package if you're + interested in optimization for the current CPU.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2570882" id= - "id2570882"></a>12.1.2. Restricted + <h3 class="title"><a name="id2590685" id= + "id2590685"></a>12.1.2. Restricted packages</h3> </div> </div> @@ -7836,7 +7965,7 @@ CFLAGS+= -your -flags <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class="varname">RESTRICTED</tt></p> + <p><code class="varname">RESTRICTED</code></p> <p>This variable should be set whenever a restriction exists (regardless of its kind). Set @@ -7845,50 +7974,52 @@ CFLAGS+= -your -flags </li> <li> - <p><tt class="varname">NO_BIN_ON_CDROM</tt></p> + <p><code class= + "varname">NO_BIN_ON_CDROM</code></p> <p>Binaries may not be placed on CD-ROM. Set this - variable to <tt class= - "varname">${RESTRICTED}</tt> whenever a binary + variable to <code class= + "varname">${RESTRICTED}</code> whenever a binary package may not be included on a CD-ROM.</p> </li> <li> - <p><tt class="varname">NO_BIN_ON_FTP</tt></p> + <p><code class="varname">NO_BIN_ON_FTP</code></p> <p>Binaries may not be placed on an FTP server. - Set this variable to <tt class= - "varname">${RESTRICTED}</tt> whenever a binary + Set this variable to <code class= + "varname">${RESTRICTED}</code> whenever a binary package may not not be made available on the Internet.</p> </li> <li> - <p><tt class="varname">NO_SRC_ON_CDROM</tt></p> + <p><code class= + "varname">NO_SRC_ON_CDROM</code></p> <p>Distfiles may not be placed on CD-ROM. Set - this variable to <tt class= - "varname">${RESTRICTED}</tt> if re-distribution + this variable to <code class= + "varname">${RESTRICTED}</code> if re-distribution of the source code or other distfile(s) is not allowed on CD-ROMs.</p> </li> <li> - <p><tt class="varname">NO_SRC_ON_FTP</tt></p> + <p><code class="varname">NO_SRC_ON_FTP</code></p> <p>Distfiles may not be placed on FTP. Set this - variable to <tt class= - "varname">${RESTRICTED}</tt> if re-distribution + variable to <code class= + "varname">${RESTRICTED}</code> if re-distribution of the source code or other distfile(s) via the Internet is not allowed.</p> </li> </ul> </div> - <p>Please note that the use of <tt class= - "varname">NO_PACKAGE</tt>, <tt class= - "varname">IGNORE</tt>, <tt class= - "varname">NO_CDROM</tt>, or other generic make + <p>Please note that the use of <code class= + "varname">NO_PACKAGE</code>, <code class= + "varname">IGNORE</code>, <code class= + "varname">NO_CDROM</code>, or other generic make variables to denote restrictions is deprecated, because they unconditionally prevent users from generating binary packages!</p> @@ -7907,11 +8038,11 @@ CFLAGS+= -your -flags <p>Your package may depend on some other package being present - and there are various ways of expressing this - dependency. pkgsrc supports the <tt class= - "varname">BUILD_DEPENDS</tt> and <tt class= - "varname">DEPENDS</tt> definitions, as well as - dependencies via <tt class= - "filename">buildlink3.mk</tt>, which is the preferred + dependency. pkgsrc supports the <code class= + "varname">BUILD_DEPENDS</code> and <code class= + "varname">DEPENDS</code> definitions, as well as + dependencies via <code class= + "filename">buildlink3.mk</code>, which is the preferred way to handle dependencies, and which uses the variables named above. See <a href="#buildlink" title= "Chapter 9. Buildlink methodology">Chapter 9, @@ -7919,21 +8050,21 @@ CFLAGS+= -your -flags information.</p> <p>The basic difference between the two variables is as - follows: The <tt class="varname">DEPENDS</tt> + follows: The <code class="varname">DEPENDS</code> definition registers that pre-requisite in the binary package so it will be pulled in when the binary package - is later installed, whilst the <tt class= - "varname">BUILD_DEPENDS</tt> definition does not, + is later installed, whilst the <code class= + "varname">BUILD_DEPENDS</code> definition does not, marking a dependency that is only needed for building the package.</p> <p>This means that if you only need a package present whilst you are building, it should be noted as a - <tt class="varname">BUILD_DEPENDS</tt>.</p> + <code class="varname">BUILD_DEPENDS</code>.</p> - <p>The format for a <tt class= - "varname">BUILD_DEPENDS</tt> and a <tt class= - "varname">DEPENDS</tt> definition is:</p> + <p>The format for a <code class= + "varname">BUILD_DEPENDS</code> and a <code class= + "varname">DEPENDS</code> definition is:</p> <pre class="programlisting"> <pre-req-package-name>:../../<category>/<pre-req-package> </pre> @@ -7951,9 +8082,9 @@ CFLAGS+= -your -flags <li> <p>If your package needs another package's binaries or libraries to build or run, and if - that package has a <tt class= - "filename">buildlink3.mk</tt> file available, use - it:</p> + that package has a <code class= + "filename">buildlink3.mk</code> file available, + use it:</p> <pre class="programlisting"> .include "../../graphics/jpeg/buildlink3.mk" @@ -7962,10 +8093,10 @@ CFLAGS+= -your -flags <li> <p>If your package needs to use another package - to build itself and there is no <tt class= - "filename">buildlink3.mk</tt> file available, use - the <tt class="varname">BUILD_DEPENDS</tt> - definition:</p> + to build itself and there is no <code class= + "filename">buildlink3.mk</code> file available, + use the <code class= + "varname">BUILD_DEPENDS</code> definition:</p> <pre class="programlisting"> BUILD_DEPENDS+= autoconf-2.13:../../devel/autoconf </pre> @@ -7973,16 +8104,15 @@ BUILD_DEPENDS+= autoconf-2.13:../../devel/autoconf <li> <p>If your package needs a library with which to - link and again there is no <tt class= - "filename">buildlink3.mk</tt> file available, - this is specified using the <tt class= - "varname">DEPENDS</tt> definition. An example of - this is the <a xmlns= + link and again there is no <code class= + "filename">buildlink3.mk</code> file available, + this is specified using the <code class= + "varname">DEPENDS</code> definition. An example + of this is the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/lyx/README.html" - class="pkgname">print/lyx</a> package, which - uses the xpm library, version 3.4j to - build:</p> + class="pkgname">print/lyx</a> package, which uses + the xpm library, version 3.4j to build:</p> <pre class="programlisting"> DEPENDS+= xpm-3.4j:../../graphics/xpm </pre> @@ -8007,7 +8137,7 @@ DEPENDS+= xpm-[0-9]*:../../graphics/xpm ambiguous matches such as “<span class= "quote">tk-postgresql</span>” matching a “<span class="quote">tk-*</span>” - <tt class="varname">DEPENDS</tt>.</p> + <code class="varname">DEPENDS</code>.</p> <p>Wildcards can also be used to specify that a package will only build against a certain minimum @@ -8029,19 +8159,20 @@ DEPENDS+= tiff>=3.5.4:../../graphics/tiff such as security updates or ABI changes that do not prevent a package from building correctly. Such recommendations can be expressed using - <tt class="varname">RECOMMENDED</tt>:</p> + <code class="varname">RECOMMENDED</code>:</p> <pre class="programlisting"> RECOMMENDED+= tiff>=3.6.1:../../graphics/tiff </pre> - <p>In addition to the above <tt class= - "varname">DEPENDS</tt> line, this denotes that + <p>In addition to the above <code class= + "varname">DEPENDS</code> line, this denotes that while a package will build against tiff>=3.5.4, at least version 3.6.1 is - recommended. <tt class="varname">RECOMMENDED</tt> - entries will be turned into dependencies unless - explicitly ignored (in which case a warning will - be printed). Packages that are built with + recommended. <code class= + "varname">RECOMMENDED</code> entries will be + turned into dependencies unless explicitly + ignored (in which case a warning will be + printed). Packages that are built with recommendations ignored may not be uploaded to ftp.NetBSD.org by developers and should not be used across different systems that may have @@ -8050,7 +8181,7 @@ RECOMMENDED+= tiff>=3.6.1:../../graphics/tiff <p>For security fixes, please update the package vulnerabilities file as well as setting - <tt class="varname">RECOMMENDED</tt>, see + <code class="varname">RECOMMENDED</code>, see <a href="#security-handling" title= "12.1.7. Handling packages with security problems"> Section 12.1.7, “Handling packages with @@ -8061,15 +8192,14 @@ RECOMMENDED+= tiff>=3.6.1:../../graphics/tiff <li> <p>If your package needs some executable to be able to run correctly and if there's agail no - <tt class="filename">buildlink3.mk</tt> file, - this is specified using the <tt class= - "varname">DEPENDS</tt> variable. The <a xmlns= + <code class="filename">buildlink3.mk</code> file, + this is specified using the <code class= + "varname">DEPENDS</code> variable. The <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/lyx/README.html" - class="pkgname">print/lyx</a> package needs to - be able to execute the latex binary from the - teTeX package when it runs, and that is - specified:</p> + class="pkgname">print/lyx</a> package needs to be + able to execute the latex binary from the teTeX + package when it runs, and that is specified:</p> <pre class="programlisting"> DEPENDS+= teTeX-[0-9]*:../../print/teTeX </pre> @@ -8085,9 +8215,9 @@ DEPENDS+= teTeX-[0-9]*:../../print/teTeX "quote">do-configure</span>” target <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/ghostscript5/README.html" - class="pkgname">print/ghostscript5</a> package (it - relies on the jpeg sources being present in source - form during the build):</p> + class="pkgname">print/ghostscript5</a> package (it + relies on the jpeg sources being present in source form + during the build):</p> <pre class="programlisting"> if [ ! -e ${_PKGSRCDIR}/graphics/jpeg/${WRKDIR:T}/jpeg-6b ]; then \ cd ${_PKGSRCDIR}/../../graphics/jpeg && ${MAKE} extract; \ @@ -8103,29 +8233,29 @@ pre-clean: cd ${_PKGSRCDIR}/../../graphics/jpeg && ${MAKE} clean </pre> - <p>Please also note the <tt class= - "varname">BUILD_USES_MSGFMT</tt> and <tt class= - "varname">BUILD_USES_GETTEXT_M4</tt> definitions, which - are provided as convenience definitions. The former - works out whether msgfmt(1) is part of the base system, - and, if it isn't, installs the <a xmlns= + <p>Please also note the <code class= + "varname">BUILD_USES_MSGFMT</code> and <code class= + "varname">BUILD_USES_GETTEXT_M4</code> definitions, + which are provided as convenience definitions. The + former works out whether msgfmt(1) is part of the base + system, and, if it isn't, installs the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/gettext/README.html" - class="pkgname">devel/gettext</a> package. The - latter adds a build dependency on either an - installed version of an older gettext package, or if - it isn't, installs the <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/gettext-m4/README.html" - class="pkgname">devel/gettext-m4</a> package.</p> + class="pkgname">devel/gettext</a> package. The latter + adds a build dependency on either an installed version + of an older gettext package, or if it isn't, installs + the <a xmlns="http://www.w3.org/TR/xhtml1/transitional" + href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/gettext-m4/README.html" + class="pkgname">devel/gettext-m4</a> package.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571260" id= - "id2571260"></a>12.1.4. Handling conflicts + <h3 class="title"><a name="id2591201" id= + "id2591201"></a>12.1.4. Handling conflicts with other packages</h3> </div> </div> @@ -8136,26 +8266,26 @@ pre-clean: your package installs the same set of files like another package in our pkgsrc tree.</p> - <p>In this case you can set <tt class= - "varname">CONFLICTS</tt> to a space separated list of + <p>In this case you can set <code class= + "varname">CONFLICTS</code> to a space separated list of packages (including version string) your package conflicts with.</p> <p>For example <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/Xaw3d/README.html" - class="pkgname">x11/Xaw3d</a> and <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/Xaw-Xpm/README.html" - class="pkgname">x11/Xaw-Xpm</a> install provide the - same shared library, thus you set in <tt class= - "filename">pkgsrc/x11/Xaw3d/Makefile</tt>:</p> + class="pkgname">x11/Xaw3d</a> and <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/Xaw-Xpm/README.html" + class="pkgname">x11/Xaw-Xpm</a> install provide the + same shared library, thus you set in <code class= + "filename">pkgsrc/x11/Xaw3d/Makefile</code>:</p> <pre class="programlisting"> CONFLICTS= Xaw-Xpm-[0-9]* </pre> - <p>and in <tt class= - "filename">pkgsrc/x11/Xaw-Xpm/Makefile</tt>:</p> + <p>and in <code class= + "filename">pkgsrc/x11/Xaw-Xpm/Makefile</code>:</p> <pre class="programlisting"> CONFLICTS= Xaw3d-[0-9]* </pre> @@ -8172,8 +8302,8 @@ CONFLICTS= Xaw3d-[0-9]* <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571447" id= - "id2571447"></a>12.1.5. Packages that cannot + <h3 class="title"><a name="id2591251" id= + "id2591251"></a>12.1.5. Packages that cannot or should not be built</h3> </div> </div> @@ -8182,19 +8312,20 @@ CONFLICTS= Xaw3d-[0-9]* <p>There are several reasons why a package might be instructed to not build under certain circumstances. If the package builds and runs on most platforms, the - exceptions should be noted with <tt class= - "varname">NOT_FOR_PLATFORM</tt>. If the package builds - and runs on a small handful of platforms, set - <tt class="varname">ONLY_FOR_PLATFORM</tt> instead. If - the package should be skipped (for example, because it - provides functionality already provided by the system), - set <tt class="varname">PKG_SKIP_REASON</tt> to a - descriptive message. If the package should fail because - some preconditions are not met, set <tt class= - "varname">PKG_FAIL_REASON</tt> to a descriptive + exceptions should be noted with <code class= + "varname">NOT_FOR_PLATFORM</code>. If the package + builds and runs on a small handful of platforms, set + <code class="varname">ONLY_FOR_PLATFORM</code> instead. + If the package should be skipped (for example, because + it provides functionality already provided by the + system), set <code class= + "varname">PKG_SKIP_REASON</code> to a descriptive + message. If the package should fail because some + preconditions are not met, set <code class= + "varname">PKG_FAIL_REASON</code> to a descriptive message.</p> - <p><tt class="varname">IGNORE</tt> is deprecated + <p><code class="varname">IGNORE</code> is deprecated because it didn't provide enough information to determine whether the build should fail.</p> </div> @@ -8203,17 +8334,17 @@ CONFLICTS= Xaw3d-[0-9]* <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571473" id= - "id2571473"></a>12.1.6. Packages which + <h3 class="title"><a name="id2591413" id= + "id2591413"></a>12.1.6. Packages which should not be deleted, once installed</h3> </div> </div> </div> <p>To ensure that a package may not be deleted, once it - has been installed, the <tt class= - "varname">PKG_PRESERVE</tt> definition should be set in - the package Makefile. This will be carried into any + has been installed, the <code class= + "varname">PKG_PRESERVE</code> definition should be set + in the package Makefile. This will be carried into any binary package that is made from this pkgsrc entry. A “<span class="quote">preserved</span>” package will not be deleted using <a href= @@ -8236,27 +8367,28 @@ CONFLICTS= Xaw3d-[0-9]* </div> <p>When a vulnerability is found, this should be noted - in <tt class= - "filename">localsrc/security/advisories/pkg-vulnerabilities</tt>, + in <code class= + "filename">localsrc/security/advisories/pkg-vulnerabilities</code>, and after the commit of that file, it should be copied - to both <tt class= - "filename">/pub/NetBSD/packages/distfiles/pkg-vulnerabilities</tt> - and <tt class= - "filename">/pub/NetBSD/packages/distfiles/vulnerabilities</tt> - on ftp.NetBSD.org using <tt class= - "filename">localsrc/security/advisories/Makefile</tt>. - In addition, if a <tt class= - "filename">buildlink3.mk</tt> file exists for an - affected package, bumping <tt class= - "varname">PKGREVISION</tt> and creating a corresponding - <tt class="varname">BUILDLINK_RECOMMENDED.<i class= - "replaceable"><tt>pkg</tt></i></tt> entry should be - considered. See <a href="#buildlink" title= + to both <code class= + "filename">/pub/NetBSD/packages/distfiles/pkg-vulnerabilities</code> + and <code class= + "filename">/pub/NetBSD/packages/distfiles/vulnerabilities</code> + on ftp.NetBSD.org using <code class= + "filename">localsrc/security/advisories/Makefile</code>. + In addition, if a <code class= + "filename">buildlink3.mk</code> file exists for an + affected package, bumping <code class= + "varname">PKGREVISION</code> and creating a + corresponding <code class= + "varname">BUILDLINK_RECOMMENDED.<em class= + "replaceable"><code>pkg</code></em></code> entry should + be considered. See <a href="#buildlink" title= "Chapter 9. Buildlink methodology">Chapter 9, <i>Buildlink methodology</i></a> for more information - about writing <tt class="filename">buildlink3.mk</tt> - files and <tt class="varname">BUILDLINK_*</tt> - definitions.</p> + about writing <code class= + "filename">buildlink3.mk</code> files and <code class= + "varname">BUILDLINK_*</code> definitions.</p> <p>Also, if the fix should be applied to the stable pkgsrc branch, be sure to submit a pullup request!</p> @@ -8266,8 +8398,8 @@ CONFLICTS= Xaw3d-[0-9]* <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571564" id= - "id2571564"></a>12.1.8. How to handle + <h3 class="title"><a name="id2591505" id= + "id2591505"></a>12.1.8. How to handle compiler bugs</h3> </div> </div> @@ -8280,11 +8412,11 @@ CONFLICTS= Xaw3d-[0-9]* or never finishing compiling a file.</p> <p>Typically a workaround involves testing the - <tt class="varname">MACHINE_ARCH</tt> and compiler + <code class="varname">MACHINE_ARCH</code> and compiler version, disabling optimisation for that - file/<tt class="varname">MACHINE_ARCH</tt>/compiler - combination, and documenting it in <tt class= - "filename">pkgsrc/doc/HACKS</tt>. See that file for a + file/<code class="varname">MACHINE_ARCH</code>/compiler + combination, and documenting it in <code class= + "filename">pkgsrc/doc/HACKS</code>. See that file for a number of examples!</p> </div> @@ -8292,8 +8424,8 @@ CONFLICTS= Xaw3d-[0-9]* <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571587" id= - "id2571587"></a>12.1.9. How to handle + <h3 class="title"><a name="id2591527" id= + "id2591527"></a>12.1.9. How to handle incrementing versions when fixing an existing package</h3> </div> @@ -8301,29 +8433,29 @@ CONFLICTS= Xaw3d-[0-9]* </div> <p>When making fixes to an existing package it can be - useful to change the version number in <tt class= - "varname">PKGNAME</tt>. To avoid conflicting with + useful to change the version number in <code class= + "varname">PKGNAME</code>. To avoid conflicting with future versions by the original author, a “<span class="quote">nb1</span>”, “<span class="quote">nb2</span>”, ... suffix can be used on package versions by setting - <tt class="varname">PKGREVISION=1</tt> (2, ...). The - “<span class="quote">nb</span>” is treated - like a “<span class="quote">.</span>” by - the pkg tools. e.g.</p> + <code class="varname">PKGREVISION=1</code> (2, ...). + The “<span class="quote">nb</span>” is + treated like a “<span class= + "quote">.</span>” by the pkg tools. e.g.</p> <pre class="programlisting"> DISTNAME= foo-17.42 PKGREVISION= 9 </pre> - <p>will result in a <tt class="varname">PKGNAME</tt> of - “<span class= + <p>will result in a <code class= + "varname">PKGNAME</code> of “<span class= "quote">foo-17.42nb9</span>”.</p> <p>When a new release of the package is released, the - <tt class="varname">PKGREVISION</tt> should be removed. - e.g. on a new minor release of the above package, - things should be like:</p> + <code class="varname">PKGREVISION</code> should be + removed. e.g. on a new minor release of the above + package, things should be like:</p> <pre class="programlisting"> DISTNAME= foo-17.43 </pre> @@ -8333,8 +8465,8 @@ DISTNAME= foo-17.43 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571704" id= - "id2571704"></a>12.1.10. Portability of + <h3 class="title"><a name="id2591644" id= + "id2591644"></a>12.1.10. Portability of packages</h3> </div> </div> @@ -8350,15 +8482,15 @@ DISTNAME= foo-17.43 <div class="titlepage"> <div> <div> - <h4 class="title"><a name="id2571709" id= - "id2571709"></a>12.1.10.1. ${INSTALL}, + <h4 class="title"><a name="id2591650" id= + "id2591650"></a>12.1.10.1. ${INSTALL}, ${INSTALL_DATA_DIR}, ...</h4> </div> </div> </div> - <p>The BSD-compatible <span><b class= - "command">install</b></span> supplied with some + <p>The BSD-compatible <span><strong class= + "command">install</strong></span> supplied with some operating systems will not perform more than one operation at a time. As such, you should call “<span class="quote">${INSTALL}</span>”, @@ -8376,7 +8508,7 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2571729" id="id2571729"></a>12.2. Possible + "id2591669" id="id2591669"></a>12.2. Possible downloading issues</h2> </div> </div> @@ -8386,8 +8518,8 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571732" id= - "id2571732"></a>12.2.1. Packages whose + <h3 class="title"><a name="id2591672" id= + "id2591672"></a>12.2.1. Packages whose distfiles aren't available for plain downloading</h3> </div> @@ -8395,62 +8527,61 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 </div> <p>If you need to download from a dynamic URL you can - set <tt class="varname">DYNAMIC_MASTER_SITES</tt> and a - <span><b class="command">make fetch</b></span> will - call <tt class="filename">files/getsite.sh</tt> with - the name of each file to download as an argument, - expecting it to output the URL of the directory from - which to download it. <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= + set <code class="varname">DYNAMIC_MASTER_SITES</code> + and a <span><strong class="command">make + fetch</strong></span> will call <code class= + "filename">files/getsite.sh</code> with the name of + each file to download as an argument, expecting it to + output the URL of the directory from which to download + it. <a xmlns="http://www.w3.org/TR/xhtml1/transitional" + href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/graphics/ns-cult3d/README.html" - class="pkgname">graphics/ns-cult3d</a> is an example - of this usage.</p> + class="pkgname">graphics/ns-cult3d</a> is an example of + this usage.</p> <p>If the download can't be automated, because the user must submit personal information to apply for a password, or must pay for the source, or whatever, you - can set <tt class="varname">_FETCH_MESSAGE</tt> to a - macro which displays a message explaining the - situation. <tt class="varname">_FETCH_MESSAGE</tt> must - be executable shell commands, not just a message. - (Generally, it executes <tt class= - "varname">${ECHO}</tt>). As of this writing, the + can set <code class="varname">_FETCH_MESSAGE</code> to + a macro which displays a message explaining the + situation. <code class="varname">_FETCH_MESSAGE</code> + must be executable shell commands, not just a message. + (Generally, it executes <code class= + "varname">${ECHO}</code>). As of this writing, the following packages use this: <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/audio/realplayer/README.html" - class="pkgname">audio/realplayer</a>, <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/cad/simian/README.html" - class="pkgname">cad/simian</a>, <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/ipv6socket/README.html" - class="pkgname">devel/ipv6socket</a>, <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/emulators/vmware-module/README.html" - class="pkgname">emulators/vmware-module</a>, - <a xmlns="http://www.w3.org/TR/xhtml1/transitional" - href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/fonts/acroread-jpnfont/README.html" - class="pkgname">fonts/acroread-jpnfont</a>, <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/sysutils/storage-manager/README.html" - class="pkgname">sysutils/storage-manager</a>, - <a xmlns="http://www.w3.org/TR/xhtml1/transitional" - href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/ap-aolserver/README.html" - class="pkgname">www/ap-aolserver</a>, <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= - "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/openacs/README.html" - class="pkgname">www/openacs</a>. Try to be - consistent with them.</p> + class="pkgname">audio/realplayer</a>, <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/cad/simian/README.html" + class="pkgname">cad/simian</a>, <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/ipv6socket/README.html" + class="pkgname">devel/ipv6socket</a>, <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/emulators/vmware-module/README.html" + class="pkgname">emulators/vmware-module</a>, <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/fonts/acroread-jpnfont/README.html" + class="pkgname">fonts/acroread-jpnfont</a>, <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/sysutils/storage-manager/README.html" + class="pkgname">sysutils/storage-manager</a>, <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/ap-aolserver/README.html" + class="pkgname">www/ap-aolserver</a>, <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/openacs/README.html" + class="pkgname">www/openacs</a>. Try to be consistent + with them.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2571795" id= - "id2571795"></a>12.2.2. How to handle + <h3 class="title"><a name="id2591735" id= + "id2591735"></a>12.2.2. How to handle modified distfiles with the 'old' name</h3> </div> </div> @@ -8465,8 +8596,8 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 package's md5 checksum to match the package on the master site (beware, any mirrors may not be up to date yet!), and to remove the old distfile from - ftp.NetBSD.org's <tt class= - "filename">/pub/NetBSD/packages/distfiles</tt> + ftp.NetBSD.org's <code class= + "filename">/pub/NetBSD/packages/distfiles</code> directory. Furthermore, a mail to the package's author seems appropriate making sure the distfile was really updated on purpose, and that no trojan horse or so @@ -8479,8 +8610,8 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 <div> <div> <h2 class="title" style="clear: both"><a name= - "id2571806" id= - "id2571806"></a>12.3. Configuration + "id2591747" id= + "id2591747"></a>12.3. Configuration gotchas</h2> </div> </div> @@ -8507,11 +8638,11 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 hand to test things. The <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/libtool/README.html" - class="pkgname">devel/libtool</a> pkg can help here, - as it just “<span class= - "quote">knows</span>” how to build both static - and dynamic libraries from a set of source files, - thus being platform independent.</p> + class="pkgname">devel/libtool</a> pkg can help here, as + it just “<span class="quote">knows</span>” + how to build both static and dynamic libraries from a + set of source files, thus being platform + independent.</p> <p>Here's how to use libtool in a pkg in seven simple steps:</p> @@ -8519,8 +8650,9 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 <div class="orderedlist"> <ol type="1"> <li> - <p>Add <tt class="varname">USE_LIBTOOL=yes</tt> - to the package Makefile.</p> + <p>Add <code class= + "varname">USE_LIBTOOL=yes</code> to the package + Makefile.</p> </li> <li> @@ -8529,11 +8661,11 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 ${CC}</span>” in place of “<span class="quote">${CC}</span>”. You could even add it to the definition of - <tt class="varname">CC</tt>, if only libraries - are being built in a given Makefile. This one - command will build both PIC and non-PIC library - objects, so you need not have separate shared and - non-shared library rules.</p> + <code class="varname">CC</code>, if only + libraries are being built in a given Makefile. + This one command will build both PIC and non-PIC + library objects, so you need not have separate + shared and non-shared library rules.</p> </li> <li> @@ -8548,15 +8680,15 @@ ${LIBTOOL} --mode=link ${CC} -o ${.TARGET:.a=.la} ${OBJS:.o=.lo} -rpath ${PREFIX </pre> <p>Note that the library is changed to have a - <tt class="filename">.la</tt> extension, and the - objects are changed to have a <tt class= - "filename">.lo</tt> extension. Change <tt class= - "varname">OBJS</tt> as necessary. This - automatically creates all of the <tt class= - "filename">.a</tt>, <tt class= - "filename">.so.major.minor</tt>, and ELF symlinks - (if necessary) in the build directory. Be sure to - include “<span class= + <code class="filename">.la</code> extension, and + the objects are changed to have a <code class= + "filename">.lo</code> extension. Change + <code class="varname">OBJS</code> as necessary. + This automatically creates all of the + <code class="filename">.a</code>, <code class= + "filename">.so.major.minor</code>, and ELF + symlinks (if necessary) in the build directory. + Be sure to include “<span class= "quote">-version-info</span>”, especially when major and minor are zero, as libtool will otherwise strip off the shared library @@ -8601,27 +8733,30 @@ dynamic linker chooses the library with the greater REVISION number. argument</span>” is the install directory of the library being built.</p> - <p>In the <tt class="filename">PLIST</tt>, - include all of the <tt class="filename">.a</tt>, - <tt class="filename">.la</tt>, and <tt class= - "filename">.so</tt>, <tt class= - "filename">.so.<i class= - "replaceable"><tt>major</tt></i></tt> and - <tt class="filename">.so.<i class= - "replaceable"><tt>major</tt></i>.<i class= - "replaceable"><tt>minor</tt></i></tt> files.</p> + <p>In the <code class="filename">PLIST</code>, + include all of the <code class= + "filename">.a</code>, <code class= + "filename">.la</code>, and <code class= + "filename">.so</code>, <code class= + "filename">.so.<em class= + "replaceable"><code>major</code></em></code> and + <code class="filename">.so.<em class= + "replaceable"><code>major</code></em>.<em class= + "replaceable"><code>minor</code></em></code> + files.</p> </li> <li> - <p>When linking shared object (<tt class= - "filename">.so</tt>) files, i.e. files that are + <p>When linking shared object (<code class= + "filename">.so</code>) files, i.e. files that are loaded via dlopen(3), NOT shared libraries, use “<span class="quote">-module -avoid-version</span>” to prevent them getting version tacked on.</p> - <p>The <tt class="filename">PLIST</tt> file gets - the <tt class="filename">foo.so</tt> entry.</p> + <p>The <code class="filename">PLIST</code> file + gets the <code class="filename">foo.so</code> + entry.</p> </li> <li> @@ -8644,16 +8779,16 @@ dynamic linker chooses the library with the greater REVISION number. “<span class= "quote">-L../somelib</span>”), because it expects you to change that argument to be the - <tt class="filename">.la</tt> file. e.g.</p> + <code class="filename">.la</code> file. e.g.</p> <pre class="programlisting"> ${LIBTOOL} --mode=link ${CC} -o someprog -L../somelib -lsomelib </pre> <p>should be changed to:</p> <pre class="programlisting"> -${LIBTOOL} --mode=link ${CC} -o <i class= -"replaceable"><tt>someprog</tt></i> <i class= -"replaceable"><tt>../somelib/somelib.la</tt></i> +${LIBTOOL} --mode=link ${CC} -o <em class= +"replaceable"><code>someprog</code></em> <em class= +"replaceable"><code>../somelib/somelib.la</code></em> </pre> <p>and it will do the right thing with the @@ -8671,14 +8806,14 @@ ${LIBTOOL} --mode=link ${CC} -o <i class= "refentrytitle">cp</span>(1)</span></a> command with “<span class="quote">${LIBTOOL} --mode=install</span>”, and change the - library name to <tt class="filename">.la</tt>. - e.g.</p> + library name to <code class= + "filename">.la</code>. e.g.</p> <pre class="programlisting"> ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib </pre> - <p>This will install the static <tt class= - "filename">.a</tt>, shared library, any needed + <p>This will install the static <code class= + "filename">.a</code>, shared library, any needed symlinks, and run <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?ldconfig+8+NetBSD-current"> <span class="citerefentry"><span class= @@ -8686,13 +8821,15 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib </li> <li> - <p>In your <tt class="filename">PLIST</tt>, - include all of the <tt class="filename">.a</tt>, - <tt class="filename">.la</tt>, and <tt class= - "filename">.so</tt>, <tt class= - "filename">.so.CURRENT</tt> and <tt class= - "filename">.so.CURRENT.REVISION</tt> files (this - is a change from the previous behaviour).</p> + <p>In your <code class="filename">PLIST</code>, + include all of the <code class= + "filename">.a</code>, <code class= + "filename">.la</code>, and <code class= + "filename">.so</code>, <code class= + "filename">.so.CURRENT</code> and <code class= + "filename">.so.CURRENT.REVISION</code> files + (this is a change from the previous + behaviour).</p> </li> </ol> </div> @@ -8702,39 +8839,40 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2572350" id= - "id2572350"></a>12.3.2. Using libtool on GNU + <h3 class="title"><a name="id2592086" id= + "id2592086"></a>12.3.2. Using libtool on GNU packages that already support libtool</h3> </div> </div> </div> - <p>Add <tt class="varname">USE_LIBTOOL=yes</tt> to the - package Makefile. This will override the package's own - libtool in most cases. For older libtool using + <p>Add <code class="varname">USE_LIBTOOL=yes</code> to + the package Makefile. This will override the package's + own libtool in most cases. For older libtool using packages, libtool is made by ltconfig script during the do-configure step; you can check the libtool script - location by doing <span><b class="command">make - configure; find work*/ -name libtool</b></span>.</p> - - <p><tt class="varname">LIBTOOL_OVERRIDE</tt> specifies - which libtool scripts, relative to <tt class= - "varname">WRKSRC</tt>, to override. By default, it is - set to “<span class="quote">libtool */libtool - */*/libtool</span>”. If this does not match the - location of the package's libtool script(s), set it as - appropriate.</p> - - <p>If you do not need <tt class="filename">*.a</tt> + location by doing <span><strong class="command">make + configure; find work*/ -name + libtool</strong></span>.</p> + + <p><code class="varname">LIBTOOL_OVERRIDE</code> + specifies which libtool scripts, relative to + <code class="varname">WRKSRC</code>, to override. By + default, it is set to “<span class= + "quote">libtool */libtool */*/libtool</span>”. If + this does not match the location of the package's + libtool script(s), set it as appropriate.</p> + + <p>If you do not need <code class="filename">*.a</code> static libraries built and installed, then use - <tt class="varname">SHLIBTOOL_OVERRIDE</tt> + <code class="varname">SHLIBTOOL_OVERRIDE</code> instead.</p> <p>If your package makes use of the platform independent library for loading dynamic shared objects, that comes with libtool (libltdl), you should include - the libtool buildlink3.mk (and set <tt class= - "varname">USE_BUILDLINK3=YES</tt>).</p> + the libtool buildlink3.mk (and set <code class= + "varname">USE_BUILDLINK3=YES</code>).</p> <p>Some packages use libtool incorrectly so that the package may not work or build in some circumstances. @@ -8752,8 +8890,9 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib <ol type="1"> <li> <p>The shared object is named correctly, - i.e. <tt class="filename">libfoo.la</tt>, - not <tt class="filename">foo.la</tt></p> + i.e. <code class= + "filename">libfoo.la</code>, not + <code class="filename">foo.la</code></p> </li> <li> @@ -8768,8 +8907,8 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib <p>The use of libltdl without the correct calls to initialisation routines. The function lt_dlinit() should be called and the macro - <tt class= - "varname">LTDL_SET_PRELOADED_SYMBOLS</tt> + <code class= + "varname">LTDL_SET_PRELOADED_SYMBOLS</code> included in executables.</p> </li> </ul> @@ -8780,8 +8919,8 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2572435" id= - "id2572435"></a>12.3.3. GNU + <h3 class="title"><a name="id2592238" id= + "id2592238"></a>12.3.3. GNU Autoconf/Automake</h3> </div> </div> @@ -8791,11 +8930,11 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib executed to regenerate the configure script and Makefile.in makefile templates, then they should be executed in a pre-configure target. Two Makefile - fragments are provided in <tt class= - "filename">pkgsrc/mk/autoconf.mk</tt> and <tt class= - "filename">pkgsrc/mk/automake.mk</tt> to help dealing - with these tools. See comments in these files for - details.</p> + fragments are provided in <code class= + "filename">pkgsrc/mk/autoconf.mk</code> and + <code class="filename">pkgsrc/mk/automake.mk</code> to + help dealing with these tools. See comments in these + files for details.</p> <p>For packages that need only autoconf:</p> <pre class="programlisting"> @@ -8828,16 +8967,16 @@ pre-configure: <p>Packages which use GNU Automake will almost certainly require GNU Make, but that's automatically - provided for you in <tt class= - "filename">mk/automake.mk</tt>.</p> + provided for you in <code class= + "filename">mk/automake.mk</code>.</p> <p>There are times when the configure process makes additional changes to the generated files, which then causes the build process to try to re-execute the automake sequence. This is prevented by touching various files in the configure stage. If this causes - problems with your package you can set <tt class= - "varname">AUTOMAKE_OVERRIDE=NO</tt> in the package + problems with your package you can set <code class= + "varname">AUTOMAKE_OVERRIDE=NO</code> in the package Makefile.</p> </div> </div> @@ -8847,7 +8986,7 @@ pre-configure: <div> <div> <h2 class="title" style="clear: both"><a name= - "id2572480" id="id2572480"></a>12.4. Building + "id2592283" id="id2592283"></a>12.4. Building considerations</h2> </div> </div> @@ -8857,8 +8996,8 @@ pre-configure: <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2572483" id= - "id2572483"></a>12.4.1. CPP defines</h3> + <h3 class="title"><a name="id2592286" id= + "id2592286"></a>12.4.1. CPP defines</h3> </div> </div> </div> @@ -8870,8 +9009,8 @@ pre-configure: <p>To test whether you are working on a 4.4 BSD-derived system, you should use the BSD definition, which is - defined in <tt class= - "filename"><sys/param.h></tt> on said + defined in <code class= + "filename"><sys/param.h></code> on said systems.</p> <pre class="programlisting"> #include <sys/param.h> @@ -8897,7 +9036,7 @@ pre-configure: <div> <div> <h2 class="title" style="clear: both"><a name= - "id2572513" id="id2572513"></a>12.5. Package + "id2592316" id="id2592316"></a>12.5. Package specific actions</h2> </div> </div> @@ -8907,78 +9046,81 @@ pre-configure: <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2572516" id= - "id2572516"></a>12.5.1. Package + <h3 class="title"><a name="id2592320" id= + "id2592320"></a>12.5.1. Package configuration files</h3> </div> </div> </div> <p>Packages should be taught to look for their - configuration files in <tt class= - "varname">${PKG_SYSCONFDIR}</tt>, which is passed + configuration files in <code class= + "varname">${PKG_SYSCONFDIR}</code>, which is passed through to the configure and build processes. - <tt class="varname">PKG_SYSCONFDIR</tt> may be + <code class="varname">PKG_SYSCONFDIR</code> may be customized in various ways by setting other make variables:</p> <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class="varname">PKG_SYSCONFBASE</tt> is - the main config directory under which all package - configuration files are to be found. This - defaults to <tt class= - "filename">${PREFIX}/etc</tt>, but may be - overridden in <tt class= - "filename">/etc/mk.conf</tt>.</p> + <p><code class="varname">PKG_SYSCONFBASE</code> + is the main config directory under which all + package configuration files are to be found. This + defaults to <code class= + "filename">${PREFIX}/etc</code>, but may be + overridden in <code class= + "filename">/etc/mk.conf</code>.</p> </li> <li> - <p><tt class="varname">PKG_SYSCONFSUBDIR</tt> is - the subdirectory of <tt class= - "varname">PKG_SYSCONFBASE</tt> under which the + <p><code class="varname">PKG_SYSCONFSUBDIR</code> + is the subdirectory of <code class= + "varname">PKG_SYSCONFBASE</code> under which the configuration files for a particular package may be found, e.g. the Apache configuration files may - all be found under the <tt class= - "filename">httpd/</tt> subdirectory of <tt class= - "varname">${PKG_SYSCONFBASE}</tt>. This should be - set in the package Makefile.</p> + all be found under the <code class= + "filename">httpd/</code> subdirectory of + <code class="varname">${PKG_SYSCONFBASE}</code>. + This should be set in the package Makefile.</p> </li> <li> - <p>By default, <tt class= - "varname">PKG_SYSCONFDIR</tt> is set to - <tt class="varname">${PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR}</tt>, - but this may be overridden by setting <tt class= - "varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</tt> - for a particular package, where <tt class= - "varname">PKG_SYSCONFVAR</tt> defaults to - <tt class="varname">${PKGBASE}</tt>. This is not - meant to be set by a package Makefile, but is + <p>By default, <code class= + "varname">PKG_SYSCONFDIR</code> is set to + <code class= + "varname">${PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR}</code>, + but this may be overridden by setting + <code class="varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code> + for a particular package, where <code class= + "varname">PKG_SYSCONFVAR</code> defaults to + <code class="varname">${PKGBASE}</code>. This is + not meant to be set by a package Makefile, but is reserved for users who wish to override the - <tt class="varname">PKG_SYSCONFDIR</tt> setting - for a particular package with a special + <code class="varname">PKG_SYSCONFDIR</code> + setting for a particular package with a special location.</p> </li> </ul> </div> <p>The only variables that users should customize are - <tt class="varname">PKG_SYSCONFBASE</tt> and <tt class= - "varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</tt>. Users - will typically want to set <tt class= - "varname">PKG_SYSCONFBASE</tt> to <tt class= - "filename">/etc</tt>, or to accept the default location - of <tt class="filename">${PREFIX}/etc</tt>.</p> + <code class="varname">PKG_SYSCONFBASE</code> and + <code class= + "varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code>. + Users will typically want to set <code class= + "varname">PKG_SYSCONFBASE</code> to <code class= + "filename">/etc</code>, or to accept the default + location of <code class= + "filename">${PREFIX}/etc</code>.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2572618" id= - "id2572618"></a>12.5.2. User + <h3 class="title"><a name="id2592490" id= + "id2592490"></a>12.5.2. User interaction</h3> </div> </div> @@ -9008,11 +9150,11 @@ pre-configure: </ul> </div> - <p>The <tt class="varname">INTERACTIVE_STAGE</tt> + <p>The <code class="varname">INTERACTIVE_STAGE</code> definition is provided to notify the pkgsrc mechanism of an interactive stage which will be needed, and this - should be set in the package's <tt class= - "filename">Makefile</tt>. e.g.</p> + should be set in the package's <code class= + "filename">Makefile</code>. e.g.</p> <pre class="programlisting"> INTERACTIVE_STAGE= build </pre> @@ -9027,8 +9169,8 @@ INTERACTIVE_STAGE= configure install <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2572663" id= - "id2572663"></a>12.5.3. Handling + <h3 class="title"><a name="id2592535" id= + "id2592535"></a>12.5.3. Handling licenses</h3> </div> </div> @@ -9048,12 +9190,12 @@ INTERACTIVE_STAGE= configure install installed.</p> <p>Placing a certain package under a certain license - works by setting the <tt class="varname">LICENSE</tt> - variable to a string identifying the license, e.g. in - <a xmlns="http://www.w3.org/TR/xhtml1/transitional" - href= + works by setting the <code class= + "varname">LICENSE</code> variable to a string + identifying the license, e.g. in <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/graphics/graphviz/README.html" - class="pkgname">graphics/graphviz</a>:</p> + class="pkgname">graphics/graphviz</a>:</p> <pre class="programlisting"> LICENSE= graphviz-license </pre> @@ -9062,7 +9204,8 @@ LICENSE= graphviz-license that the package underlies a license which he hasn't accepted (yet):</p> <pre class="programlisting"> -<tt class="prompt">%</tt> <b class="userinput"><tt>make</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>make</code></strong> ===> graphviz-1.12 has an unacceptable license: graphviz-license. ===> To build this package, add this line to your /etc/mk.conf: ===> ACCEPTABLE_LICENSES+=graphviz-license @@ -9070,39 +9213,39 @@ LICENSE= graphviz-license *** Error code 1 </pre> - <p>The license can be viewed with <span><b class= - "command">make show-license</b></span>, and if it is - considered appropriate, the line printed above can be - added to <tt class="filename">/etc/mk.conf</tt> to - indicate acceptance of the particular license:</p> + <p>The license can be viewed with <span><strong class= + "command">make show-license</strong></span>, and if it + is considered appropriate, the line printed above can + be added to <code class="filename">/etc/mk.conf</code> + to indicate acceptance of the particular license:</p> <pre class="programlisting"> ACCEPTABLE_LICENSES+=graphviz-license </pre> <p>When adding a package with a new license, the - license text should be added to <tt class= - "filename">pkgsrc/licenses</tt> for displaying. A list - of known licenses can be seen in this directory as well - as by looking at the list of (commented out) <tt class= - "varname">ACCEPTABLE_LICENSES</tt> variable settings in - <tt class= - "filename">pkgsrc/mk/bsd.pkg.defaults.mk</tt>.</p> + license text should be added to <code class= + "filename">pkgsrc/licenses</code> for displaying. A + list of known licenses can be seen in this directory as + well as by looking at the list of (commented out) + <code class="varname">ACCEPTABLE_LICENSES</code> + variable settings in <code class= + "filename">pkgsrc/mk/bsd.pkg.defaults.mk</code>.</p> <p>Is there is a <span class= "emphasis"><em>really</em></span> pressing need to accept all licenses at once, like when trying to download or mirror all distfiles or doing a bulk build to test if all packages in pkgsrc build, this can be - done by setting <tt class= - "varname">_ACCEPTABLE=yes</tt>.</p> + done by setting <code class= + "varname">_ACCEPTABLE=yes</code>.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2572746" id= - "id2572746"></a>12.5.4. Creating an account + <h3 class="title"><a name="id2592686" id= + "id2592686"></a>12.5.4. Creating an account from a package</h3> </div> </div> @@ -9110,11 +9253,11 @@ ACCEPTABLE_LICENSES+=graphviz-license <p>There are two make variables used to control the creation of package-specific groups and users at - pre-install time. The first is <tt class= - "varname">PKG_GROUPS</tt>, which is a list of + pre-install time. The first is <code class= + "varname">PKG_GROUPS</code>, which is a list of group[:groupid] elements, where the groupid is - optional. The second is <tt class= - "varname">PKG_USERS</tt>, which is a list of elements + optional. The second is <code class= + "varname">PKG_USERS</code>, which is a list of elements of the form:</p> <pre class="programlisting"> user:group[:[userid][:[description][:[home][:shell]]]] @@ -9136,27 +9279,28 @@ user:group[:[userid][:[description][:[home][:shell]]]] </pre> <p>By default, a new user will have home directory - <tt class="filename">/nonexistent</tt>, and login shell - <tt class="filename">/sbin/nologin</tt> unless they are - specified as part of the user element.</p> - - <p>The package <tt class="filename">Makefile</tt> must - also set <tt class="varname">USE_PKGINSTALL=YES</tt>. - This will cause the users and groups to be created at - pre-install time, and the admin will be prompted to - remove them at post-deinstall time. Automatic creation - of the users and groups can be toggled on and off by - setting the <tt class= - "varname">PKG_CREATE_USERGROUP</tt> variable prior to - package installation.</p> + <code class="filename">/nonexistent</code>, and login + shell <code class="filename">/sbin/nologin</code> + unless they are specified as part of the user + element.</p> + + <p>The package <code class="filename">Makefile</code> + must also set <code class= + "varname">USE_PKGINSTALL=YES</code>. This will cause + the users and groups to be created at pre-install time, + and the admin will be prompted to remove them at + post-deinstall time. Automatic creation of the users + and groups can be toggled on and off by setting the + <code class="varname">PKG_CREATE_USERGROUP</code> + variable prior to package installation.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2572876" id= - "id2572876"></a>12.5.5. Installing score + <h3 class="title"><a name="id2592748" id= + "id2592748"></a>12.5.5. Installing score files</h3> </div> </div> @@ -9169,46 +9313,47 @@ user:group[:[userid][:[description][:[home][:shell]]]] and the score files owned by the appropriate group and/or owner (traditionally the "games" user/group). The following variables, documented in more detail in - <tt class="filename">mk/bsd.pkg.defaults.mk</tt>, - control this behaviour: <tt class= - "varname">SETGIDGAME</tt>, <tt class= - "varname">GAMEDATAMODE</tt>, <tt class= - "varname">GAMEGRP</tt>, <tt class= - "varname">GAMEMODE</tt>, <tt class= - "varname">GAMEOWN</tt>.</p> + <code class="filename">mk/bsd.pkg.defaults.mk</code>, + control this behaviour: <code class= + "varname">SETGIDGAME</code>, <code class= + "varname">GAMEDATAMODE</code>, <code class= + "varname">GAMEGRP</code>, <code class= + "varname">GAMEMODE</code>, <code class= + "varname">GAMEOWN</code>.</p> <p>Note that per default, setgid installation of games - is disabled; setting <tt class= - "varname">SETGIDGAME=YES</tt> will set all the other + is disabled; setting <code class= + "varname">SETGIDGAME=YES</code> will set all the other variables accordingly.</p> <p>A package should therefor never hard code file - ownership or access permissions but rely on <tt class= - "varname">INSTALL_GAME</tt> and <tt class= - "varname">INSTALL_GAME_DATA</tt> to set these - correctly.</p> + ownership or access permissions but rely on + <code class="varname">INSTALL_GAME</code> and + <code class="varname">INSTALL_GAME_DATA</code> to set + these correctly.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573057" id= - "id2573057"></a>12.5.6. Packages providing + <h3 class="title"><a name="id2592929" id= + "id2592929"></a>12.5.6. Packages providing login shells</h3> </div> </div> </div> <p>If the purpose of the package is to provide a login - shell, the variable <tt class="varname">PKG_SHELL</tt> - should contain the full pathname of the shell - executable installed by this package. The package - <tt class="filename">Makefile</tt> must also set - <tt class="varname">USE_PKGINSTALL=YES</tt> to use the - automatically generated <tt class= - "filename">INSTALL</tt>/<tt class= - "filename">DEINSTALL</tt> scripts.</p> + shell, the variable <code class= + "varname">PKG_SHELL</code> should contain the full + pathname of the shell executable installed by this + package. The package <code class= + "filename">Makefile</code> must also set <code class= + "varname">USE_PKGINSTALL=YES</code> to use the + automatically generated <code class= + "filename">INSTALL</code>/<code class= + "filename">DEINSTALL</code> scripts.</p> <p>An example taken from shells/zsh:</p> <pre class="programlisting"> @@ -9216,39 +9361,39 @@ user:group[:[userid][:[description][:[home][:shell]]]] PKG_SHELL= ${PREFIX}/bin/zsh </pre> - <p>The shell is registered into <tt class= - "filename">/etc/shells</tt> file automatically in the - post-install target by the generated <tt class= - "filename">INSTALL</tt> script and removed in the - deinstall target by the <tt class= - "filename">DEINSTALL</tt> script.</p> + <p>The shell is registered into <code class= + "filename">/etc/shells</code> file automatically in the + post-install target by the generated <code class= + "filename">INSTALL</code> script and removed in the + deinstall target by the <code class= + "filename">DEINSTALL</code> script.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573182" id= - "id2573182"></a>12.5.7. Packages containing + <h3 class="title"><a name="id2593054" id= + "id2593054"></a>12.5.7. Packages containing perl scripts</h3> </div> </div> </div> <p>If your package contains interpreted perl scripts, - set <tt class="varname">REPLACE_PERL</tt> to ensure - that the proper interpreter path is set. <tt class= - "varname">REPLACE_PERL</tt> should contain a list of - scripts, relative to <tt class="varname">WRKSRC</tt>, - that you want adjusted.</p> + set <code class="varname">REPLACE_PERL</code> to ensure + that the proper interpreter path is set. <code class= + "varname">REPLACE_PERL</code> should contain a list of + scripts, relative to <code class= + "varname">WRKSRC</code>, that you want adjusted.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573201" id= - "id2573201"></a>12.5.8. Packages with + <h3 class="title"><a name="id2593073" id= + "id2593073"></a>12.5.8. Packages with hardcoded paths to other interpreters</h3> </div> </div> @@ -9258,9 +9403,9 @@ user:group[:[userid][:[description][:[home][:shell]]]] paths to other interpreters besides (or as well as) perl. To correct the full pathname to the script interpreter, you need to set the following definitions - in your <tt class="filename">Makefile</tt> (we shall - use <span><b class="command">tclsh</b></span> in this - example):</p> + in your <code class="filename">Makefile</code> (we + shall use <span><strong class= + "command">tclsh</strong></span> in this example):</p> <pre class="programlisting"> REPLACE_INTERPRETER+= tcl _REPLACE.tcl.old= .*/bin/tclsh @@ -9274,43 +9419,43 @@ user:group[:[userid][:[description][:[home][:shell]]]] <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573222" id= - "id2573222"></a>12.5.9. Packages installing + <h3 class="title"><a name="id2593094" id= + "id2593094"></a>12.5.9. Packages installing perl modules</h3> </div> </div> </div> <p>Makefiles of packages providing perl5 modules should - include the Makefile fragment <tt class= - "filename">../../lang/perl5/module.mk</tt>. It provides - a <span><b class="command">do-configure</b></span> - target for the standard perl configuration for such - modules as well as various hooks to tune this - configuration. See comments in this file for - details.</p> + include the Makefile fragment <code class= + "filename">../../lang/perl5/module.mk</code>. It + provides a <span><strong class= + "command">do-configure</strong></span> target for the + standard perl configuration for such modules as well as + various hooks to tune this configuration. See comments + in this file for details.</p> <p>Perl5 modules will install into different places depending on the version of perl used during the build process. To address this, pkgsrc will append lines to - the <tt class="filename">PLIST</tt> corresponding to - the files listed in the installed <tt class= - "filename">.packlist</tt> file generated by most perl5 - modules. This is invoked by defining <tt class= - "varname">PERL5_PACKLIST</tt> to a space-separated list - of paths to packlist files, e.g.:</p> + the <code class="filename">PLIST</code> corresponding + to the files listed in the installed <code class= + "filename">.packlist</code> file generated by most + perl5 modules. This is invoked by defining <code class= + "varname">PERL5_PACKLIST</code> to a space-separated + list of paths to packlist files, e.g.:</p> <pre class="programlisting"> PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </pre> - <p>The variables <tt class= - "varname">PERL5_SITELIB</tt>, <tt class= - "varname">PERL5_SITEARCH</tt>, and <tt class= - "varname">PERL5_ARCHLIB</tt> represent the three + <p>The variables <code class= + "varname">PERL5_SITELIB</code>, <code class= + "varname">PERL5_SITEARCH</code>, and <code class= + "varname">PERL5_ARCHLIB</code> represent the three locations in which perl5 modules may be installed, and may be used by perl5 packages that don't have a packlist. These three variables are also substituted - for in the <tt class="filename">PLIST</tt>.</p> + for in the <code class="filename">PLIST</code>.</p> </div> <div class="sect2" lang="en" xml:lang="en"> @@ -9333,30 +9478,30 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <ul type="disc"> <li> <p>is considered to be installed in the directory - <tt class= - "filename">${PREFIX}/${INFO_DIR}</tt>,</p> + <code class= + "filename">${PREFIX}/${INFO_DIR}</code>,</p> </li> <li> <p>is registered in the Info directory file - <tt class= - "filename">${PREFIX}/${INFO_DIR}/dir</tt>,</p> + <code class= + "filename">${PREFIX}/${INFO_DIR}/dir</code>,</p> </li> <li> <p>and must be listed as a filename in the - <tt class="varname">INFO_FILES</tt> variable in - the package Makefile.</p> + <code class="varname">INFO_FILES</code> variable + in the package Makefile.</p> </li> </ul> </div> - <p><tt class="varname">INFO_DIR</tt> defaults to + <p><code class="varname">INFO_DIR</code> defaults to “<span class="quote">info</span>” and can - be overridden in the package Makefile. <tt class= - "filename">INSTALL</tt> and <tt class= - "filename">DEINSTALL</tt> scripts will be generated to - handle registration of the info files in the Info + be overridden in the package Makefile. <code class= + "filename">INSTALL</code> and <code class= + "filename">DEINSTALL</code> scripts will be generated + to handle registration of the info files in the Info directory file. The “<span class= "quote">install-info</span>” command used for the info files registration is either provided by the @@ -9365,72 +9510,75 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p>A package which needs the “<span class= "quote">makeinfo</span>” command at build time - must define the variable <tt class= - "varname">USE_MAKEINFO</tt> in its Makefile. If a + must define the variable <code class= + "varname">USE_MAKEINFO</code> in its Makefile. If a minimum version of the “<span class= "quote">makeinfo</span>” command is needed it - should be noted with the <tt class= - "varname">TEXINFO_REQD</tt> variable in the package - <tt class="filename">Makefile</tt>. By default, a + should be noted with the <code class= + "varname">TEXINFO_REQD</code> variable in the package + <code class="filename">Makefile</code>. By default, a minimum version of 3.12 is required. If the system does - not provide a <span><b class= - "command">makeinfo</b></span> command or if it does not - match the required minimum, a build dependency on the - <a xmlns="http://www.w3.org/TR/xhtml1/transitional" - href= + not provide a <span><strong class= + "command">makeinfo</strong></span> command or if it + does not match the required minimum, a build dependency + on the <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/gtexinfo/README.html" - class="pkgname">devel/gtexinfo</a> package will be - added automatically.</p> + class="pkgname">devel/gtexinfo</a> package will be + added automatically.</p> <p>The build and installation process of the software provided by the package should not use the - <span><b class="command">install-info</b></span> - command as the registration of info files is the task - of the package <tt class="filename">INSTALL</tt> - script, and it must use the appropriate <span><b class= - "command">makeinfo</b></span> command.</p> + <span><strong class= + "command">install-info</strong></span> command as the + registration of info files is the task of the package + <code class="filename">INSTALL</code> script, and it + must use the appropriate <span><strong class= + "command">makeinfo</strong></span> command.</p> <p>To achieve this goal the pkgsrc infrastructure - creates overriding scripts for the <span><b class= - "command">install-info</b></span> and <span><b class= - "command">makeinfo</b></span> commands in a directory - listed early in <tt class="varname">PATH</tt>.</p> - - <p>The script overriding <span><b class= - "command">install-info</b></span> has no effect except - the logging of a message. The script overriding - <span><b class="command">makeinfo</b></span> logs a - message and according to the value of <tt class= - "varname">USE_MAKEINFO</tt> and <tt class= - "varname">TEXINFO_REQD</tt> either run the appropriate - <span><b class="command">makeinfo</b></span> command or - exit on error.</p> + creates overriding scripts for the <span><strong class= + "command">install-info</strong></span> and + <span><strong class="command">makeinfo</strong></span> + commands in a directory listed early in <code class= + "varname">PATH</code>.</p> + + <p>The script overriding <span><strong class= + "command">install-info</strong></span> has no effect + except the logging of a message. The script overriding + <span><strong class="command">makeinfo</strong></span> + logs a message and according to the value of + <code class="varname">USE_MAKEINFO</code> and + <code class="varname">TEXINFO_REQD</code> either run + the appropriate <span><strong class= + "command">makeinfo</strong></span> command or exit on + error.</p> </div> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573442" id= - "id2573442"></a>12.5.11. Packages installing + <h3 class="title"><a name="id2593450" id= + "id2593450"></a>12.5.11. Packages installing GConf2 data files</h3> </div> </div> </div> - <p>If a package installs <tt class= - "filename">.schemas</tt> or <tt class= - "filename">.entries</tt> files, used by GConf2, you + <p>If a package installs <code class= + "filename">.schemas</code> or <code class= + "filename">.entries</code> files, used by GConf2, you need to take some extra steps to make sure they get registered in the database:</p> <div class="orderedlist"> <ol type="1"> <li> - <p>Include <tt class= - "filename">../../devel/GConf2/schemas.mk</tt> - instead of its <tt class= - "filename">buildlink3.mk</tt> file. This takes + <p>Include <code class= + "filename">../../devel/GConf2/schemas.mk</code> + instead of its <code class= + "filename">buildlink3.mk</code> file. This takes care of rebuilding the GConf2 database at installation and deinstallation time, and tells the package where to install GConf2 data files @@ -9441,11 +9589,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <li> <p>Ensure that the package installs its - <tt class="filename">.schemas</tt> files under - <tt class= - "filename">${PREFIX}/share/gconf/schemas</tt>. If - they get installed under <tt class= - "filename">${PREFIX}/etc</tt>, you will need to + <code class="filename">.schemas</code> files + under <code class= + "filename">${PREFIX}/share/gconf/schemas</code>. + If they get installed under <code class= + "filename">${PREFIX}/etc</code>, you will need to manually patch the package.</p> </li> @@ -9460,21 +9608,23 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </li> <li> - <p>Define the <tt class= - "varname">GCONF2_SCHEMAS</tt> variable in your - <tt class="filename">Makefile</tt> with a list of - all <tt class="filename">.schemas</tt> files - installed by the package, if any. Names must not - contain any directories in them.</p> + <p>Define the <code class= + "varname">GCONF2_SCHEMAS</code> variable in your + <code class="filename">Makefile</code> with a + list of all <code class= + "filename">.schemas</code> files installed by the + package, if any. Names must not contain any + directories in them.</p> </li> <li> - <p>Define the <tt class= - "varname">GCONF2_ENTRIES</tt> variable in your - <tt class="filename">Makefile</tt> with a list of - all <tt class="filename">.entries</tt> files - installed by the package, if any. Names must not - contain any directories in them.</p> + <p>Define the <code class= + "varname">GCONF2_ENTRIES</code> variable in your + <code class="filename">Makefile</code> with a + list of all <code class= + "filename">.entries</code> files installed by the + package, if any. Names must not contain any + directories in them.</p> </li> </ol> </div> @@ -9484,25 +9634,25 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573610" id= - "id2573610"></a>12.5.12. Packages installing + <h3 class="title"><a name="id2593550" id= + "id2593550"></a>12.5.12. Packages installing scrollkeeper data files</h3> </div> </div> </div> - <p>If a package installs <tt class="filename">.omf</tt> - files, used by scrollkeeper, you need to take some - extra steps to make sure they get registered in the - database:</p> + <p>If a package installs <code class= + "filename">.omf</code> files, used by scrollkeeper, you + need to take some extra steps to make sure they get + registered in the database:</p> <div class="orderedlist"> <ol type="1"> <li> - <p>Include <tt class= - "filename">../../textproc/scrollkeeper/omf.mk</tt> - instead of its <tt class= - "filename">buildlink3.mk</tt> file. This takes + <p>Include <code class= + "filename">../../textproc/scrollkeeper/omf.mk</code> + instead of its <code class= + "filename">buildlink3.mk</code> file. This takes care of rebuilding the scrollkeeper database at installation and deinstallation time, and disallows any access to it directly from the @@ -9511,15 +9661,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <li> <p>Check the PLIST and remove any entries under - the <tt class= - "filename">libdata/scrollkeeper</tt> directory, + the <code class= + "filename">libdata/scrollkeeper</code> directory, as they will be handled automatically.</p> </li> <li> - <p>Remove the <tt class="filename">share/omf</tt> - directory from the PLIST. It will be handled by - scrollkeeper.</p> + <p>Remove the <code class= + "filename">share/omf</code> directory from the + PLIST. It will be handled by scrollkeeper.</p> </li> </ol> </div> @@ -9529,8 +9679,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573661" id= - "id2573661"></a>12.5.13. Packages installing + <h3 class="title"><a name="id2593602" id= + "id2593602"></a>12.5.13. Packages installing X11 fonts</h3> </div> </div> @@ -9539,20 +9689,22 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p>If a package installs font files, you will need to rebuild the fonts database in the directory where they get installed at installation and deinstallation time. - This can be automatically done by using <tt class= - "filename">mk/fonts.mk</tt>, which you need to include - in your <tt class="filename">Makefile</tt>.</p> + This can be automatically done by using <code class= + "filename">mk/fonts.mk</code>, which you need to + include in your <code class= + "filename">Makefile</code>.</p> <p>When the file is included, you can list the - directories where fonts are installed in the <tt class= - "varname">FONTS_<i class= - "replaceable"><tt>type</tt></i>_DIRS</tt> variables, - where <i class="replaceable"><tt>type</tt></i> can be - one of “<span class="quote">TTF</span>”, + directories where fonts are installed in the + <code class="varname">FONTS_<em class= + "replaceable"><code>type</code></em>_DIRS</code> + variables, where <em class= + "replaceable"><code>type</code></em> can be one of + “<span class="quote">TTF</span>”, “<span class="quote">TYPE1</span>” or “<span class="quote">X11</span>”. Also make - sure that the database file <tt class= - "filename">fonts.dir</tt> is not listed in the + sure that the database file <code class= + "filename">fonts.dir</code> is not listed in the PLIST.</p> <p>Note that you should not create new directories for @@ -9565,8 +9717,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573708" id= - "id2573708"></a>12.5.14. Packages installing + <h3 class="title"><a name="id2593649" id= + "id2593649"></a>12.5.14. Packages installing GTK2 modules</h3> </div> </div> @@ -9579,22 +9731,24 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="orderedlist"> <ol type="1"> <li> - <p>Include <tt class= - "filename">../../x11/gtk2/modules.mk</tt> instead - of its <tt class="filename">buildlink3.mk</tt> - file. This takes care of rebuilding the database - at installation and deinstallation time.</p> + <p>Include <code class= + "filename">../../x11/gtk2/modules.mk</code> + instead of its <code class= + "filename">buildlink3.mk</code> file. This takes + care of rebuilding the database at installation + and deinstallation time.</p> </li> <li> - <p>Set <tt class= - "varname">GTK2_IMMODULES=YES</tt> if your package - installs GTK2 immodules.</p> + <p>Set <code class= + "varname">GTK2_IMMODULES=YES</code> if your + package installs GTK2 immodules.</p> </li> <li> - <p>Set <tt class="varname">GTK2_LOADERS=YES</tt> - if your package installs GTK2 loaders.</p> + <p>Set <code class= + "varname">GTK2_LOADERS=YES</code> if your package + installs GTK2 loaders.</p> </li> <li> @@ -9604,13 +9758,13 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class= - "filename">libdata/gtk-2.0/gdk-pixbuf.loaders</tt></p> + <p><code class= + "filename">libdata/gtk-2.0/gdk-pixbuf.loaders</code></p> </li> <li> - <p><tt class= - "filename">libdata/gtk-2.0/gtk.immodules</tt></p> + <p><code class= + "filename">libdata/gtk-2.0/gtk.immodules</code></p> </li> </ul> </div> @@ -9618,7 +9772,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <li> <p>Check the PLIST and remove any entries under - the <tt class="filename">libdata/gtk-2.0</tt> + the <code class="filename">libdata/gtk-2.0</code> directory, as they will be handled automatically.</p> </li> @@ -9630,8 +9784,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573778" id= - "id2573778"></a>12.5.15. Packages installing + <h3 class="title"><a name="id2593718" id= + "id2593718"></a>12.5.15. Packages installing SGML or XML data</h3> </div> </div> @@ -9645,29 +9799,29 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="orderedlist"> <ol type="1"> <li> - <p>Include <tt class= - "filename">../../textproc/xmlcatmgr/catalogs.mk</tt> - in your <tt class="filename">Makefile</tt>, which - takes care of registering those files in + <p>Include <code class= + "filename">../../textproc/xmlcatmgr/catalogs.mk</code> + in your <code class="filename">Makefile</code>, + which takes care of registering those files in system-wide catalogs at installation and deinstallation time.</p> </li> <li> - <p>Set <tt class="varname">SGML_CATALOGS</tt> to - the full path of any SGML catalogs installed by - the package.</p> + <p>Set <code class="varname">SGML_CATALOGS</code> + to the full path of any SGML catalogs installed + by the package.</p> </li> <li> - <p>Set <tt class="varname">XML_CATALOGS</tt> to - the full path of any XML catalogs installed by + <p>Set <code class="varname">XML_CATALOGS</code> + to the full path of any XML catalogs installed by the package.</p> </li> <li> - <p>Set <tt class="varname">SGML_ENTRIES</tt> to - individual entries to be added to the SGML + <p>Set <code class="varname">SGML_ENTRIES</code> + to individual entries to be added to the SGML catalog. These come in groups of three strings; see xmlcatmgr(1) for more information (specifically, arguments recognized by the 'add' @@ -9676,8 +9830,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </li> <li> - <p>Set <tt class="varname">XML_ENTRIES</tt> to - individual entries to be added to the XML + <p>Set <code class="varname">XML_ENTRIES</code> + to individual entries to be added to the XML catalog. These come in groups of three strings; see xmlcatmgr(1) for more information (specifically, arguments recognized by the 'add' @@ -9692,42 +9846,44 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573830" id= - "id2573830"></a>12.5.16. Packages installing + <h3 class="title"><a name="id2593770" id= + "id2593770"></a>12.5.16. Packages installing extensions to the MIME database</h3> </div> </div> </div> <p>If a package provides extensions to the MIME - database by installing <tt class="filename">.xml</tt> - files inside <tt class= - "filename">${PREFIX}/share/mime/packages</tt>, you need - to take some extra steps to ensure that the database is - kept consistent with respect to these new files:</p> + database by installing <code class= + "filename">.xml</code> files inside <code class= + "filename">${PREFIX}/share/mime/packages</code>, you + need to take some extra steps to ensure that the + database is kept consistent with respect to these new + files:</p> <div class="orderedlist"> <ol type="1"> <li> - <p>Include <tt class= - "filename">../../databases/shared-mime-info/mimedb.mk</tt> - (avoid using the <tt class= - "filename">buildlink3.mk</tt> file from this same - directory, which is reserved for inclusion from - other <tt class="filename">buildlink3.mk</tt> - files). It takes care of rebuilding the MIME - database at installation and deinstallation time, - and disallows any access to it directly from the + <p>Include <code class= + "filename">../../databases/shared-mime-info/mimedb.mk</code> + (avoid using the <code class= + "filename">buildlink3.mk</code> file from this + same directory, which is reserved for inclusion + from other <code class= + "filename">buildlink3.mk</code> files). It takes + care of rebuilding the MIME database at + installation and deinstallation time, and + disallows any access to it directly from the package.</p> </li> <li> <p>Check the PLIST and remove any entries under - the <tt class="filename">share/mime</tt> + the <code class="filename">share/mime</code> directory, <span class= "emphasis"><em>except</em></span> for files saved - under <tt class= - "filename">share/mime/packages</tt>. The former + under <code class= + "filename">share/mime/packages</code>. The former are handled automatically by the update-mime-database program, but the later are package-dependent and must be removed by the @@ -9736,9 +9892,9 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </li> <li> - <p>Remove any <tt class= - "filename">share/mime/*</tt> directories from the - PLIST. They will be handled by the + <p>Remove any <code class= + "filename">share/mime/*</code> directories from + the PLIST. They will be handled by the shared-mime-info package.</p> </li> </ol> @@ -9749,16 +9905,16 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2573969" id= - "id2573969"></a>12.5.17. Packages using + <h3 class="title"><a name="id2593841" id= + "id2593841"></a>12.5.17. Packages using intltool</h3> </div> </div> </div> <p>If a package uses intltool during its build, include - the <tt class= - "filename">../../textproc/intltool/buildlink3.mk</tt> + the <code class= + "filename">../../textproc/intltool/buildlink3.mk</code> file, which forces it to use the intltool package provided by pkgsrc, instead of the one bundled with the distribution file.</p> @@ -9775,7 +9931,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2573982" id="id2573982"></a>12.6. Feedback + "id2593854" id="id2593854"></a>12.6. Feedback to the author</h2> </div> </div> @@ -9813,153 +9969,159 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="itemizedlist"> <ul type="disc"> <li> - <p>Be sure to set <tt class= - "varname">PKG_DEVELOPER=1</tt> in <tt class= - "filename">/etc/mk.conf</tt></p> + <p>Be sure to set <code class= + "varname">PKG_DEVELOPER=1</code> in <code class= + "filename">/etc/mk.conf</code></p> </li> <li> <p>Install <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/url2pkg/README.html" - class="pkgname">pkgtools/url2pkg</a>, create a - directory for a new package, change into it, then - run <span><b class= - "command">url2pkg</b></span>:</p> + class="pkgname">pkgtools/url2pkg</a>, create a + directory for a new package, change into it, then run + <span><strong class= + "command">url2pkg</strong></span>:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>mkdir /usr/pkgsrc/<i class= -"replaceable"><tt>category</tt></i>/<i class= -"replaceable"><tt>examplepkg</tt></i></tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>cd /usr/pkgsrc/<i class= -"replaceable"><tt>category</tt></i>/<i class= -"replaceable"><tt>examplepkg</tt></i></tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>url2pkg http://www.example.com/path/to/distfile.tar.gz</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>mkdir /usr/pkgsrc/<em class= +"replaceable"><code>category</code></em>/<em class= +"replaceable"><code>examplepkg</code></em></code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>cd /usr/pkgsrc/<em class= +"replaceable"><code>category</code></em>/<em class= +"replaceable"><code>examplepkg</code></em></code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>url2pkg http://www.example.com/path/to/distfile.tar.gz</code></strong> </pre> </li> <li> - <p>Edit the <tt class="filename">Makefile</tt> as + <p>Edit the <code class="filename">Makefile</code> as requested.</p> </li> <li> - <p>Fill in the <tt class="filename">DESCR</tt> + <p>Fill in the <code class="filename">DESCR</code> file</p> </li> <li> - <p>Run <span><b class="command">make - configure</b></span></p> + <p>Run <span><strong class="command">make + configure</strong></span></p> </li> <li> <p>Add any dependencies glimpsed from documentation - and the configure step to the package's <tt class= - "filename">Makefile</tt>.</p> + and the configure step to the package's <code class= + "filename">Makefile</code>.</p> </li> <li> <p>Make the package compile, doing multiple rounds of</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class="userinput"><tt>make</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>pkgvi ${WRKSRC}/some/file/that/does/not/compile</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>mkpatches</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>patchdiff</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>mv ${WRKDIR}/.newpatches/* patches</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>make mps</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>make clean</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>make</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>pkgvi ${WRKSRC}/some/file/that/does/not/compile</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>mkpatches</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>patchdiff</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>mv ${WRKDIR}/.newpatches/* patches</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>make mps</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>make clean</code></strong> </pre> <p>Doing as non-root user will ensure that no files are modified that shouldn't be, especially during the - build phase. <span><b class= - "command">mkpatches</b></span>, <span><b class= - "command">patchdiff</b></span> and <span><b class= - "command">pkgvi</b></span> are from the <a xmlns= + build phase. <span><strong class= + "command">mkpatches</strong></span>, + <span><strong class= + "command">patchdiff</strong></span> and + <span><strong class="command">pkgvi</strong></span> + are from the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdiff/README.html" - class="pkgname">pkgtools/pkgdiff</a> package.</p> + class="pkgname">pkgtools/pkgdiff</a> package.</p> </li> <li> - <p>Look at the <tt class="filename">Makefile</tt>, - fix if necessary; see <a href="#components.Makefile" - title="7.1. Makefile">Section 7.1, - “Makefile”</a>.</p> + <p>Look at the <code class= + "filename">Makefile</code>, fix if necessary; see + <a href="#components.Makefile" title= + "7.1. Makefile">Section 7.1, + “<code class= + "filename">Makefile</code>”</a>.</p> </li> <li> - <p>Generate a <tt class="filename">PLIST</tt>:</p> + <p>Generate a <code class= + "filename">PLIST</code>:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make install</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make print-PLIST >PLIST</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make deinstall</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make install</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make deinstall</tt></b> -</pre> - - <p>You usually need to be <tt class= - "username">root</tt> to do this. Look if there are +<code class="prompt">#</code> <strong class= +"userinput"><code>make install</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>make print-PLIST >PLIST</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>make deinstall</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>make install</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>make deinstall</code></strong> +</pre> + + <p>You usually need to be <code class= + "username">root</code> to do this. Look if there are any files left:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make print-PLIST</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make print-PLIST</code></strong> </pre> <p>If this reveals any files that are missing in - <tt class="filename">PLIST</tt>, add them.</p> + <code class="filename">PLIST</code>, add them.</p> </li> <li> - <p>Now that the <tt class="filename">PLIST</tt> is - OK, install the package again and make a binary + <p>Now that the <code class="filename">PLIST</code> + is OK, install the package again and make a binary package:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make reinstall</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make package</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make reinstall</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>make package</code></strong> </pre> </li> <li> <p>Delete the installed package:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>pkg_delete blub</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>pkg_delete blub</code></strong> </pre> </li> <li> - <p>Repeat the above <span><b class="command">make - print-PLIST</b></span> command, which shouldn't find - anything now:</p> + <p>Repeat the above <span><strong class= + "command">make print-PLIST</strong></span> command, + which shouldn't find anything now:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make print-PLIST</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make print-PLIST</code></strong> </pre> </li> <li> <p>Reinstall the binary package:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>pkgadd .../blub.tgz</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>pkgadd .../blub.tgz</code></strong> </pre> </li> @@ -9968,14 +10130,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </li> <li> - <p>Run <span><b class="command">pkglint</b></span> - from <a xmlns= + <p>Run <span><strong class= + "command">pkglint</strong></span> from <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>, and fix the - problems it reports:</p> + class="pkgname">pkgtools/pkglint</a>, and fix the + problems it reports:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class="userinput"><tt>pkglint</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>pkglint</code></strong> </pre> </li> @@ -10004,17 +10167,17 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2574444">14.1. + <dt><span class="sect1"><a href="#id2594385">14.1. Submitting your packages</a></span></dt> - <dt><span class="sect1"><a href="#id2574491">14.2. + <dt><span class="sect1"><a href="#id2594432">14.2. Committing: Importing a package into CVS</a></span></dt> - <dt><span class="sect1"><a href="#id2574691">14.3. + <dt><span class="sect1"><a href="#id2594563">14.3. Updating a package to a newer version</a></span></dt> - <dt><span class="sect1"><a href="#id2574710">14.4. + <dt><span class="sect1"><a href="#id2594582">14.4. Moving a package in pkgsrc</a></span></dt> </dl> </div> @@ -10024,8 +10187,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2574444" id= - "id2574444"></a>14.1. Submitting your + "id2594385" id= + "id2594385"></a>14.1. Submitting your packages</h2> </div> </div> @@ -10057,8 +10220,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <i>Debugging</i></a> and the rest of this document. Next, generate an uuencoded gzipped tar(1) archive, preferably with all files in a single directory. - Finally, <span><b class= - "command">send-pr</b></span> with category + Finally, <span><strong class= + "command">send-pr</strong></span> with category “<span class="quote">pkg</span>”, a synopsis which includes the package name and version number, a short description of your package @@ -10086,8 +10249,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2574491" id= - "id2574491"></a>14.2. Committing: Importing a + "id2594432" id= + "id2594432"></a>14.2. Committing: Importing a package into CVS</h2> </div> </div> @@ -10097,13 +10260,13 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist with write access to the pkgsrc repository. Please remember that cvs imports files relative to the current working directory, and that the pathname that you give - the <span><b class="command">cvs import</b></span> - command is so that it knows where to place the files in - the repository. Newly created packages should be imported - with a vendor tag of “<span class= - "quote">TNF</span>” and a release tag of - “<span class="quote">pkgsrc-base</span>”, - e.g:</p> + the <span><strong class="command">cvs + import</strong></span> command is so that it knows where + to place the files in the repository. Newly created + packages should be imported with a vendor tag of + “<span class="quote">TNF</span>” and a + release tag of “<span class= + "quote">pkgsrc-base</span>”, e.g:</p> <pre class="programlisting"> % cd .../pkgsrc/category/pkgname % cvs import pkgsrc/category/pkgname TNF pkgsrc-base @@ -10113,18 +10276,19 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist out of the way, or cvs will complain the next time you “<span class="quote">cvs update</span>” your source tree. Also don't forget to add the new package to - the category's <tt class="filename">Makefile</tt>.</p> + the category's <code class= + "filename">Makefile</code>.</p> <p>The commit message of the initial import should - include part of the <tt class="filename">DESCR</tt> file, - so people reading the mailing lists know what the package - is/does.</p> + include part of the <code class="filename">DESCR</code> + file, so people reading the mailing lists know what the + package is/does.</p> <p>Please note all package updates/additions in - <tt class="filename">pkgsrc/doc/CHANGES</tt>. It's very - important to keep this file up to date and conforming to - the existing format, because it will be used by scripts - to automatically update pages on <a href= + <code class="filename">pkgsrc/doc/CHANGES</code>. It's + very important to keep this file up to date and + conforming to the existing format, because it will be + used by scripts to automatically update pages on <a href= "http://www.NetBSD.org/" target="_top">www.NetBSD.org</a> and other sites. Additionally, check the pkgsrc/doc/TODO file and remove the entry for the package you updated, in @@ -10142,7 +10306,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2574691" id="id2574691"></a>14.3. Updating + "id2594563" id="id2594563"></a>14.3. Updating a package to a newer version</h2> </div> </div> @@ -10193,7 +10357,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title" style="clear: both"><a name= - "id2574710" id="id2574710"></a>14.4. Moving a + "id2594582" id="id2594582"></a>14.4. Moving a package in pkgsrc</h2> </div> </div> @@ -10211,34 +10375,35 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p>Alternatively to the first two steps you can also do:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>cvs -d user@cvs.NetBSD.org:/cvsroot export -D today pkgsrc/category/package</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>cvs -d user@cvs.NetBSD.org:/cvsroot export -D today pkgsrc/category/package</code></strong> </pre> <p>and use that for further work.</p> </li> <li> - <p>Fix <tt class="varname">CATEGORIES</tt> and any - <tt class="varname">DEPENDS</tt> paths that just - did “<span class= + <p>Fix <code class="varname">CATEGORIES</code> and + any <code class="varname">DEPENDS</code> paths that + just did “<span class= "quote">../package</span>” instead of “<span class= "quote">../../category/package</span>”.</p> </li> <li> - <p><span><b class="command">cvs import</b></span> - the modified package in the new place.</p> + <p><span><strong class="command">cvs + import</strong></span> the modified package in the + new place.</p> </li> <li> <p>Check if any package depends on it:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>cd /usr/pkgsrc</tt></b> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>grep /package */*/Makefile* */*/buildlink*</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>cd /usr/pkgsrc</code></strong> +<code class="prompt">%</code> <strong class= +"userinput"><code>grep /package */*/Makefile* */*/buildlink*</code></strong> </pre> </li> @@ -10248,25 +10413,26 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </li> <li> - <p><span><b class="command">cvs rm (-f)</b></span> - the package at the old location.</p> + <p><span><strong class="command">cvs rm + (-f)</strong></span> the package at the old + location.</p> </li> <li> - <p>Remove from <tt class= - "filename">oldcategory/Makefile</tt>.</p> + <p>Remove from <code class= + "filename">oldcategory/Makefile</code>.</p> </li> <li> - <p>Add to <tt class= - "filename">newcategory/Makefile</tt>.</p> + <p>Add to <code class= + "filename">newcategory/Makefile</code>.</p> </li> <li> <p>Commit the changed and removed files:</p> <pre class="screen"> -<tt class="prompt">%</tt> <b class= -"userinput"><tt>cvs commit oldcategory/package oldcategory/Makefile newcategory/Makefile</tt></b> +<code class="prompt">%</code> <strong class= +"userinput"><code>cvs commit oldcategory/package oldcategory/Makefile newcategory/Makefile</code></strong> </pre> <p>(and any packages from step 5, of course).</p> @@ -10292,43 +10458,45 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2575004">A.1. + <dt><span class="sect1"><a href="#id2594808">A.1. files</a></span></dt> <dd> <dl> - <dt><span class="sect2"><a href="#id2575008">A.1.1. + <dt><span class="sect2"><a href="#id2594811">A.1.1. Makefile</a></span></dt> - <dt><span class="sect2"><a href="#id2575015">A.1.2. + <dt><span class="sect2"><a href="#id2594887">A.1.2. DESCR</a></span></dt> - <dt><span class="sect2"><a href="#id2575030">A.1.3. + <dt><span class="sect2"><a href="#id2594902">A.1.3. PLIST</a></span></dt> - <dt><span class="sect2"><a href="#id2575037">A.1.4. - Checking a package with pkglint</a></span></dt> + <dt><span class="sect2"><a href="#id2594909">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="#id2575078">A.2. Steps + <dt><span class="sect1"><a href="#id2594950">A.2. Steps for building, installing, packaging</a></span></dt> </dl> </div> <p>We checked to find a piece of software that wasn't in the packages collection, and picked GNU bison. Quite why someone - would want to have <span><b class="command">bison</b></span> - when Berkeley <span><b class="command">yacc</b></span> is - already present in the tree is beyond us, but it's useful for - the purposes of this exercise.</p> + would want to have <span><strong class= + "command">bison</strong></span> when Berkeley + <span><strong class="command">yacc</strong></span> is already + present in the tree is beyond us, but it's useful for the + purposes of this exercise.</p> <div class="sect1" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both"><a name= - "id2575004" id="id2575004"></a>A.1. files</h2> + "id2594808" id="id2594808"></a>A.1. files</h2> </div> </div> </div> @@ -10337,8 +10505,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2575008" id= - "id2575008"></a>A.1.1. Makefile</h3> + <h3 class="title"><a name="id2594811" id= + "id2594811"></a>A.1.1. Makefile</h3> </div> </div> </div> @@ -10365,8 +10533,8 @@ INFO_FILES= bison.info <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2575015" id= - "id2575015"></a>A.1.2. DESCR</h3> + <h3 class="title"><a name="id2594887" id= + "id2594887"></a>A.1.2. DESCR</h3> </div> </div> </div> @@ -10382,8 +10550,8 @@ of the NetBSD source tree is beyond me. <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2575030" id= - "id2575030"></a>A.1.3. PLIST</h3> + <h3 class="title"><a name="id2594902" id= + "id2594902"></a>A.1.3. PLIST</h3> </div> </div> </div> @@ -10406,9 +10574,10 @@ share/bison.hairy <div class="titlepage"> <div> <div> - <h3 class="title"><a name="id2575037" id= - "id2575037"></a>A.1.4. Checking a package with - <span><b class="command">pkglint</b></span></h3> + <h3 class="title"><a name="id2594909" id= + "id2594909"></a>A.1.4. Checking a package with + <span><strong class= + "command">pkglint</strong></span></h3> </div> </div> </div> @@ -10416,13 +10585,15 @@ share/bison.hairy <p>The NetBSD package system comes with <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> which helps to - check the contents of these files. After installation - it is quite easy to use, just change to the directory - of the package you wish to examine and execute - <span><b class="command">pkglint</b></span>:</p> + class="pkgname">pkgtools/pkglint</a> which helps to check + the contents of these files. After installation it is + quite easy to use, just change to the directory of the + package you wish to examine and execute + <span><strong class= + "command">pkglint</strong></span>:</p> <pre class="screen"> -<tt class="prompt">$</tt> <b class="userinput"><tt>pkglint</tt></b> +<code class="prompt">$</code> <strong class= +"userinput"><code>pkglint</code></strong> OK: checking ./DESCR. OK: checking Makefile. OK: checking distinfo. @@ -10432,8 +10603,8 @@ looks fine. <p>Depending on the supplied command line arguments (see pkglint(1)) more verbose checks will be performed. Use - e.g. <span><b class="command">pkglint -v</b></span> for a - very verbose check.</p> + e.g. <span><strong class="command">pkglint + -v</strong></span> for a very verbose check.</p> </div> </div> @@ -10442,7 +10613,7 @@ looks fine. <div> <div> <h2 class="title" style="clear: both"><a name= - "id2575078" id="id2575078"></a>A.2. Steps for + "id2594950" id="id2594950"></a>A.2. Steps for building, installing, packaging</h2> </div> </div> @@ -10451,26 +10622,26 @@ looks fine. <p>Create the directory where the package lives, plus any auxiliary directories:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd /usr/pkgsrc/lang</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mkdir bison</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>cd bison</tt></b> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>mkdir patches</tt></b> -</pre> - - <p>Create <tt class="filename">Makefile</tt>, <tt class= - "filename">DESCR</tt> and <tt class="filename">PLIST</tt> - (see <a href="#components" title= +<code class="prompt">#</code> <strong class= +"userinput"><code>cd /usr/pkgsrc/lang</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mkdir bison</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>cd bison</code></strong> +<code class="prompt">#</code> <strong class= +"userinput"><code>mkdir patches</code></strong> +</pre> + + <p>Create <code class="filename">Makefile</code>, + <code class="filename">DESCR</code> and <code class= + "filename">PLIST</code> (see <a href="#components" title= "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"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make fetch</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make fetch</code></strong> >> bison-1.25.tar.gz doesn't seem to exist on this system. >> Attempting to fetch from ftp://prep.ai.mit.edu/pub/gnu//. Requesting ftp://prep.ai.mit.edu/pub/gnu//bison-1.25.tar.gz (via ftp://orpheus.amdahl.com:80/) @@ -10485,16 +10656,17 @@ Requesting ftp://ftp.freebsd.org/pub/FreeBSD/distfiles//bison-1.25.tar.gz (via f Successfully retrieved file. </pre> - <p>Generate the checksum of the distfile into <tt class= - "filename">distinfo</tt>:</p> + <p>Generate the checksum of the distfile into <code class= + "filename">distinfo</code>:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make makesum</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make makesum</code></strong> </pre> <p>Now compile:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class="userinput"><tt>make</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make</code></strong> >> Checksum OK for bison-1.25.tar.gz. ===> Extracting for bison-1.25 ===> Patching for bison-1.25 @@ -10549,8 +10721,8 @@ sed -e "/^#line/ s|bison|/usr/pkg/share/bison|" < ./bison.simple > bison.s <p>Everything seems OK, so install the files:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make install</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make install</code></strong> >> Checksum OK for bison-1.25.tar.gz. ===> Installing for bison-1.25 sh ./mkinstalldirs /usr/pkg/bin /usr/pkg/share /usr/pkg/info /usr/pkg/man/man1 @@ -10566,12 +10738,12 @@ cd .; for f in bison.info*; do /usr/bin/install -c -o bin -g bin -m 644 $f /usr </pre> <p>You can now use bison, and also - if you decide so - - remove it with <span><b class="command">pkg_delete - bison</b></span>. Should you decide that you want a binary - package, do this now:</p> + remove it with <span><strong class="command">pkg_delete + bison</strong></span>. Should you decide that you want a + binary package, do this now:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make package</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make package</code></strong> >> Checksum OK for bison-1.25.tar.gz. ===> Building package for bison-1.25 Creating package bison-1.25.tgz @@ -10582,8 +10754,8 @@ Creating gzip'd tar ball in '/u/pkgsrc/lang/bison/bison-1.25.tgz' <p>Now that you don't need the source and object files any more, clean up:</p> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make clean</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make clean</code></strong> ===> Cleaning for bison-1.25 </pre> </div> @@ -10622,7 +10794,8 @@ Creating gzip'd tar ball in '/u/pkgsrc/lang/bison/bison-1.25.tgz' </div> </div> <pre class="screen"> -<tt class="prompt">#</tt> <b class="userinput"><tt>make</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make</code></strong> ===> Checking for vulnerabilities in figlet-2.2.1nb2 => figlet221.tar.gz doesn't seem to exist on this system. => Attempting to fetch figlet221.tar.gz from ftp://ftp.figlet.org/pub/figlet/program/unix/. @@ -10693,9 +10866,9 @@ gcc -O2 -DDEFAULTFONTDIR=\"/usr/pkg/share/figlet\" -DDEFAULTFONTFILE=\"standard chmod a+x figlet gcc -O2 -o chkfont chkfont.c => Unwrapping files-to-be-installed. -<tt class="prompt">#</tt> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make install</tt></b> +<code class="prompt">#</code> +<code class="prompt">#</code> <strong class= +"userinput"><code>make install</code></strong> ===> Checking for vulnerabilities in figlet-2.2.1nb2 ===> Installing for figlet-2.2.1nb2 install -d -o root -g wheel -m 755 /usr/pkg/bin @@ -10710,7 +10883,7 @@ cp fonts/*.flf /usr/pkg/share/figlet cp fonts/*.flc /usr/pkg/share/figlet cp figlet.6 /usr/pkg/man/man6 ===> Registering installation for figlet-2.2.1nb2 -<tt class="prompt">#</tt> +<code class="prompt">#</code> </pre> </div> @@ -10725,15 +10898,15 @@ cp figlet.6 /usr/pkg/man/man6 </div> </div> <pre class="screen"> -<tt class="prompt">#</tt> <b class= -"userinput"><tt>make package</tt></b> +<code class="prompt">#</code> <strong class= +"userinput"><code>make package</code></strong> ===> Checking for vulnerabilities in figlet-2.2.1nb2 ===> Packaging figlet-2.2.1nb2 ===> Building binary package for figlet-2.2.1nb2 Creating package /home/cvs/pkgsrc/packages/i386/All/figlet-2.2.1nb2.tgz Using SrcDir value of /usr/pkg Registering depends:. -<tt class="prompt">#</tt> +<code class="prompt">#</code> </pre> </div> </div> @@ -10835,9 +11008,9 @@ Registering depends:. </li> <li> - <p>If necessary, create a symlink <span><b class= - "command">ln -s `uname -m` `uname -p`</b></span> (amiga - -> m68k, ...)</p> + <p>If necessary, create a symlink <span><strong class= + "command">ln -s `uname -m` `uname -p`</strong></span> + (amiga -> m68k, ...)</p> </li> </ol> </div> @@ -10858,10 +11031,10 @@ Registering depends:. <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#id2575861">D.1. + <dt><span class="sect1"><a href="#id2595665">D.1. Targets</a></span></dt> - <dt><span class="sect1"><a href="#id2576068">D.2. + <dt><span class="sect1"><a href="#id2595940">D.2. Procedure</a></span></dt> </dl> </div> @@ -10874,31 +11047,32 @@ Registering depends:. <div> <div> <h2 class="title" style="clear: both"><a name= - "id2575861" id="id2575861"></a>D.1. Targets</h2> + "id2595665" id="id2595665"></a>D.1. Targets</h2> </div> </div> </div> - <p>The pkgsrc guide's source code is stored in <tt class= - "filename">pkgsrc/doc/guide/files</tt>, and several files + <p>The pkgsrc guide's source code is stored in <code class= + "filename">pkgsrc/doc/guide/files</code>, and several files are created from it:</p> <div class="itemizedlist"> <ul type="disc"> <li> - <p><tt class="filename">pkgsrc/doc/pkgsrc.txt</tt>, - which replaces <tt class= - "filename">pkgsrc/Packages.txt</tt></p> + <p><code class= + "filename">pkgsrc/doc/pkgsrc.txt</code>, which + replaces <code class= + "filename">pkgsrc/Packages.txt</code></p> </li> <li> - <p><tt class= - "filename">pkgsrc/doc/pkgsrc.html</tt></p> + <p><code class= + "filename">pkgsrc/doc/pkgsrc.html</code></p> </li> <li> - <p><tt class= - "filename">http://www.NetBSD.org/Documentation/pkgsrc/</tt>: + <p><code class= + "filename">http://www.NetBSD.org/Documentation/pkgsrc/</code>: the documentation on the NetBSD website will be built from pkgsrc and kept up to date on the web server itself. This means you <span class= @@ -10907,14 +11081,14 @@ Registering depends:. </li> <li> - <p><tt class= - "filename">http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.pdf</tt>: + <p><code class= + "filename">http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.pdf</code>: PDF version of the pkgsrc guide.</p> </li> <li> - <p><tt class= - "filename">http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.ps</tt>: + <p><code class= + "filename">http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.ps</code>: PostScript version of the pkgsrc guide.</p> </li> </ul> @@ -10926,8 +11100,8 @@ Registering depends:. <div> <div> <h2 class="title" style="clear: both"><a name= - "id2576068" id= - "id2576068"></a>D.2. Procedure</h2> + "id2595940" id= + "id2595940"></a>D.2. Procedure</h2> </div> </div> </div> @@ -10947,58 +11121,62 @@ Registering depends:. PostScript- and PDF version. You will need both packages installed, to make sure documentation is consistent across all formats. The packages can be - found in <tt class= - "filename">pkgsrc/meta-pkgs/netbsd-doc</tt> and - <tt class= - "filename">pkgsrc/meta-pkgs/netbsd-doc-print</tt>.</p> + found in <code class= + "filename">pkgsrc/meta-pkgs/netbsd-doc</code> and + <code class= + "filename">pkgsrc/meta-pkgs/netbsd-doc-print</code>.</p> </li> <li> - <p>Edit the XML file(s) in <tt class= - "filename">pkgsrc/doc/guide/files</tt>.</p> + <p>Edit the XML file(s) in <code class= + "filename">pkgsrc/doc/guide/files</code>.</p> </li> <li> - <p>Run <span><b class="command">make extract - && make do-lint</b></span> in <tt class= - "filename">pkgsrc/doc/guide</tt> to check the XML - syntax, and fix it if needed.</p> + <p>Run <span><strong class="command">make extract + && make do-lint</strong></span> in + <code class="filename">pkgsrc/doc/guide</code> to + check the XML syntax, and fix it if needed.</p> </li> <li> - <p>Run <span><b class="command">make</b></span> in - <tt class="filename">pkgsrc/doc/guide</tt> to build - the HTML and ASCII version.</p> + <p>Run <span><strong class= + "command">make</strong></span> in <code class= + "filename">pkgsrc/doc/guide</code> to build the HTML + and ASCII version.</p> </li> <li> - <p>If all is well, run <span><b class="command">make - install-doc</b></span> to put the generated files - into <tt class="filename">pkgsrc/doc</tt>.</p> + <p>If all is well, run <span><strong class= + "command">make install-doc</strong></span> to put the + generated files into <code class= + "filename">pkgsrc/doc</code>.</p> </li> <li> - <p><span><b class="command">cvs commit - pkgsrc/doc/guide/files</b></span></p> + <p><span><strong class="command">cvs commit + pkgsrc/doc/guide/files</strong></span></p> </li> <li> - <p><span><b class="command">cvs commit -m re-generate - pkgsrc/doc/pkgsrc.{html,txt}</b></span></p> + <p><span><strong class="command">cvs commit -m + re-generate + pkgsrc/doc/pkgsrc.{html,txt}</strong></span></p> </li> <li> <p>Until the webserver on www.NetBSD.org is really updated automatically to pick up changes to the - pkgsrc guide automatically, also run <span><b class= - "command">make install-htdoc - HTDOCSDIR=../../../htdocs</b></span> (or similar, - adjust <tt class="varname">HTDOCSDIR</tt>!).</p> + pkgsrc guide automatically, also run + <span><strong class="command">make install-htdoc + HTDOCSDIR=../../../htdocs</strong></span> (or + similar, adjust <code class= + "varname">HTDOCSDIR</code>!).</p> </li> <li> - <p><span><b class="command">cvs commit - htdocs/Documentation/pkgsrc</b></span></p> + <p><span><strong class="command">cvs commit + htdocs/Documentation/pkgsrc</strong></span></p> </li> </ul> </div> diff --git a/doc/pkgsrc.txt b/doc/pkgsrc.txt index 998ab266ec0..3c9975e5a5a 100644 --- a/doc/pkgsrc.txt +++ b/doc/pkgsrc.txt @@ -27,53 +27,53 @@ creating new packages. Table of Contents 1. Introduction - + 1.1. Introduction 1.2. Overview 1.3. Terminology 1.4. Typography - + I. The pkgsrc user's guide - + 2. Where to get pkgsrc - + 2.1. As tar file 2.2. Via SUP 2.3. Via CVS - + 3. Using pkgsrc on systems other than NetBSD - + 3.1. Bootstrapping pkgsrc 3.2. Platform specific notes - + 3.2.1. Darwin (Mac OS X) 3.2.2. FreeBSD 3.2.3. Interix 3.2.4. IRIX 3.2.5. OpenBSD 3.2.6. Solaris - + 4. Using pkgsrc - + 4.1. Working with binary packages - + 4.1.1. Where to get binary packages 4.1.2. How to use binary packages 4.1.3. A word of warning - + 4.2. Building packages from source - + 4.2.1. Requirements 4.2.2. Fetching distfiles 4.2.3. How to build and install 4.2.4. Selecting the compiler - + 5. Creating binary packages - + 5.1. Building a single binary package 5.2. Settings for creation of binary packages 5.3. Doing a bulk build of all packages - + 5.3.1. Configuration 5.3.2. Other environmental considerations 5.3.3. Operation @@ -81,13 +81,13 @@ I. The pkgsrc user's guide 5.3.5. Disk space requirements 5.3.6. Setting up a sandbox for chroot'ed builds 5.3.7. Building a partial set of packages - + 5.4. Creating a multiple CD-ROM packages collection - + 5.4.1. Example of cdpack - + 6. Frequently Asked Questions - + 6.1. Is there a mailing list for pkg-related discussion? 6.2. Where's the pkgviews documentation? 6.3. Utilities for package management (pkgtools) @@ -97,16 +97,17 @@ I. The pkgsrc user's guide 6.7. How to fetch files from behind a firewall 6.8. How do I tell make fetch to do passive FTP? 6.9. How to fetch all distfiles at once - 6.10. What does Don't know how to make /usr/share/tmac/tmac.andoc mean? - 6.11. What does Could not find bsd.own.mk mean? + 6.10. What does "Don't know how to make /usr/share/tmac/tmac.andoc" + mean? + 6.11. What does "Could not find bsd.own.mk" mean? 6.12. Using 'sudo' with pkgsrc 6.13. Configuration files handling and placement 6.14. Automated security checks - + II. The pkgsrc developer's guide - + 7. Package components - files, directories and contents - + 7.1. Makefile 7.2. distinfo 7.3. patches/* @@ -114,9 +115,9 @@ II. The pkgsrc developer's guide 7.5. Optional files 7.6. work* 7.7. files/* - + 8. PLIST issues - + 8.1. RCS ID 8.2. Semi-automatic PLIST generation 8.3. Tweaking output of make print-PLIST @@ -125,35 +126,35 @@ II. The pkgsrc developer's guide 8.6. Changing PLIST source with PLIST_SRC 8.7. Platform specific and differing PLISTs 8.8. Sharing directories between packages - + 9. Buildlink methodology - + 9.1. Converting packages to use buildlink3 9.2. Writing buildlink3.mk files - + 9.2.1. Anatomy of a buildlink3.mk file 9.2.2. Updating BUILDLINK_DEPENDS.pkg in buildlink3.mk files - + 9.3. Writing builtin.mk files - + 9.3.1. Anatomy of a builtin.mk file 9.3.2. Global preferences for native or pkgsrc software - + 10. Options handling - + 10.1. Global default options 10.2. Converting packages to use bsd.options.mk - + 11. The build process - + 11.1. Program location 11.2. Main targets 11.3. Other helpful targets - + 12. Notes on fixes for packages - + 12.1. General operation - + 12.1.1. How to pull in variables from /etc/mk.conf 12.1.2. Restricted packages 12.1.3. Handling dependencies @@ -165,25 +166,25 @@ II. The pkgsrc developer's guide 12.1.9. How to handle incrementing versions when fixing an existing package 12.1.10. Portability of packages - + 12.2. Possible downloading issues - + 12.2.1. Packages whose distfiles aren't available for plain downloading 12.2.2. How to handle modified distfiles with the 'old' name - + 12.3. Configuration gotchas - + 12.3.1. Shared libraries - libtool 12.3.2. Using libtool on GNU packages that already support libtool 12.3.3. GNU Autoconf/Automake - + 12.4. Building considerations - + 12.4.1. CPP defines - + 12.5. Package specific actions - + 12.5.1. Package configuration files 12.5.2. User interaction 12.5.3. Handling licenses @@ -201,39 +202,39 @@ II. The pkgsrc developer's guide 12.5.15. Packages installing SGML or XML data 12.5.16. Packages installing extensions to the MIME database 12.5.17. Packages using intltool - + 12.6. Feedback to the author - + 13. Debugging 14. Submitting and Committing - + 14.1. Submitting your packages 14.2. Committing: Importing a package into CVS 14.3. Updating a package to a newer version 14.4. Moving a package in pkgsrc - + A. A simple example package: bison - + A.1. files - + A.1.1. Makefile A.1.2. DESCR A.1.3. PLIST A.1.4. Checking a package with pkglint - + A.2. Steps for building, installing, packaging - + B. Build logs - + B.1. Building figlet B.2. Packaging figlet - + C. Layout of the FTP server's package archive D. Editing guidelines for the pkgsrc guide - + D.1. Targets D.2. Procedure - + Chapter 1. Introduction Table of Contents @@ -260,13 +261,13 @@ descriptions are all simple. pkgsrc currently contains several thousand packages, including: * www/apache - The Apache web server - + * www/mozilla - The Mozilla web browser - + * meta-pkgs/gnome - The GNOME Desktop Environment - + * meta-pkgs/kde3 - The K Desktop Environment - + ...just to name a few. pkgsrc has built-in support for handling varying dependencies, such as pthreads @@ -277,23 +278,23 @@ NetBSD only. Since then, pkgsrc has grown a lot, and now supports the following platforms: * Darwin (Mac OS X) - + * DragonFlyBSD - + * FreeBSD - + * Microsoft Windows, via Interix - + * IRIX - + * Linux - + * NetBSD (of course) - + * OpenBSD - + * Solaris - + 1.2. Overview This document is divided into two parts. The first, The pkgsrc user's guide, @@ -306,59 +307,59 @@ users without knowing about the package's building details. This document is available in various formats: * HTML - + * PDF - + * PS - + * TXT - + 1.3. Terminology There has been a lot of talk about "ports", "packages", etc. so far. Here is a description of all the terminology used within this document. Package - + A set of files and building instructions that describe what's necessary to build a certain piece of software using pkgsrc. Packages are traditionally stored under /usr/pkgsrc. - + 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. - + Distfile - + This term describes the file or files that are provided by the author of the piece of software to distribute his work. All the changes necessary to build on NetBSD are reflected in the corresponding package. Usually the distfile is in the form of a compressed tar-archive, but other types are possible, too. Distfiles are usually stored below /usr/pkgsrc/distfiles. - + Port - + This is the term used by FreeBSD and OpenBSD people for what we call a package. In NetBSD terminology, "port" refers to a different architecture. - + Precompiled/binary package - + A set of binaries built with pkgsrc from a distfile and stuffed together in a single .tgz file so it can be installed on machines of the same machine architecture without the need to recompile. Packages are usually generated in /usr/pkgsrc/packages; there is also an archive on ftp.NetBSD.org. - + Sometimes, this is referred to by the term "package" too, especially in the context of precompiled packages. - + Program - + The piece of software to be installed which will be constructed from all the files in the Distfile by the actions defined in the corresponding package. - + 1.4. Typography When giving examples for commands, shell prompts are used to show if the @@ -371,44 +372,44 @@ The pkgsrc user's guide Table of Contents 2. Where to get pkgsrc - + 2.1. As tar file 2.2. Via SUP 2.3. Via CVS - + 3. Using pkgsrc on systems other than NetBSD - + 3.1. Bootstrapping pkgsrc 3.2. Platform specific notes - + 3.2.1. Darwin (Mac OS X) 3.2.2. FreeBSD 3.2.3. Interix 3.2.4. IRIX 3.2.5. OpenBSD 3.2.6. Solaris - + 4. Using pkgsrc - + 4.1. Working with binary packages - + 4.1.1. Where to get binary packages 4.1.2. How to use binary packages 4.1.3. A word of warning - + 4.2. Building packages from source - + 4.2.1. Requirements 4.2.2. Fetching distfiles 4.2.3. How to build and install 4.2.4. Selecting the compiler - + 5. Creating binary packages - + 5.1. Building a single binary package 5.2. Settings for creation of binary packages 5.3. Doing a bulk build of all packages - + 5.3.1. Configuration 5.3.2. Other environmental considerations 5.3.3. Operation @@ -416,13 +417,13 @@ Table of Contents 5.3.5. Disk space requirements 5.3.6. Setting up a sandbox for chroot'ed builds 5.3.7. Building a partial set of packages - + 5.4. Creating a multiple CD-ROM packages collection - + 5.4.1. Example of cdpack - + 6. Frequently Asked Questions - + 6.1. Is there a mailing list for pkg-related discussion? 6.2. Where's the pkgviews documentation? 6.3. Utilities for package management (pkgtools) @@ -432,12 +433,12 @@ Table of Contents 6.7. How to fetch files from behind a firewall 6.8. How do I tell make fetch to do passive FTP? 6.9. How to fetch all distfiles at once - 6.10. What does Don't know how to make /usr/share/tmac/tmac.andoc mean? - 6.11. What does Could not find bsd.own.mk mean? + 6.10. What does "Don't know how to make /usr/share/tmac/tmac.andoc" mean? + 6.11. What does "Could not find bsd.own.mk" mean? 6.12. Using 'sudo' with pkgsrc 6.13. Configuration files handling and placement 6.14. Automated security checks - + Chapter 2. Where to get pkgsrc Table of Contents @@ -492,14 +493,14 @@ Table of Contents 3.1. Bootstrapping pkgsrc 3.2. Platform specific notes - + 3.2.1. Darwin (Mac OS X) 3.2.2. FreeBSD 3.2.3. Interix 3.2.4. IRIX 3.2.5. OpenBSD 3.2.6. Solaris - + 3.1. Bootstrapping pkgsrc For Operating Systems other than NetBSD, we provide a bootstrap kit to build @@ -508,19 +509,19 @@ NetBSD, pkgsrc and the bootstrap kit have support for the following operating systems: * Darwin (Mac OS X) - + * FreeBSD - + * Interix (Windows 2000, XP, 2003) - + * IRIX - + * Linux - + * OpenBSD - + * Solaris - + Support for other platforms is under development. Installing the bootstrap kit should be as simple as: @@ -536,7 +537,7 @@ package database directory where pkgsrc will do it's internal bookkeeping. However, these can also be set using command-line parameters. 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 +available for supported platforms. An up-to-date list of these can be found on www.pkgsrc.org. 3.2. Platform specific notes @@ -550,7 +551,7 @@ OS X, by using a disk image, or a UFS partition. Before you start, you will need to download and install the Mac OS X Developer Tools from Apple's Developer Connection. See http://developer.apple.com/macosx/ -for details. Also, make sure you install X11 for Mac OS X and the X11 SDK from +for details. Also, make sure you install X11 for Mac OS X and the X11 SDK from http://www.apple.com/macosx/x11/download/ if you intend to build packages that use the X11 Window System. @@ -618,25 +619,25 @@ with the FreeBSD userland tools. There are several steps: 1. FreeBSD stores its ports pkg database in /var/db/pkg. It is therefore recommended that you choose a different location (e.g. /usr/pkgdb) by using the --pkgdbdir option to the bootstrap script. - + 2. If you do not intend to use the FreeBSD ports tools, it's probably a good idea to move them out of the way to avoid confusion, e.g. - + # cd /usr/sbin # mv pkg_add pkg_add.orig # mv pkg_create pkg_create.orig # mv pkg_delete pkg_delete.orig # mv pkg_info pkg_info.orig - + 3. An example /etc/mk.conf file will be placed in /etc/mk.conf.example file when you use the bootstrap script. - + 3.2.3. Interix Interix is a POSIX compatible subsystem for the Windows NT kernel, providing a Unix-like environment with a tighter kernel integration than available with Cygwin. It is part of the Windows Services for Unix package, available for free -for any licensed copy of Windows 2000, XP, or 2003. SFU can be downloaded from +for any licensed copy of Windows 2000, XP, or 2003. SFU can be downloaded from http://www.microsoft.com/windows/sfu/. Services for Unix 3.5, current as of this writing, has been tested. 3.0 or 3.1 @@ -649,13 +650,13 @@ At an absolute minimum, the following packages must be installed from the Windows Services for Unix 3.5 distribution in order to use pkgsrc: * Utilities -> Base Utilities - + * Interix GNU Components -> (all) - + * Remote Connectivity - + * Interix SDK - + When using pkgsrc on Interix, DO NOT install the Utilities subcomponent "UNIX Perl". That is Perl 5.6 without shared module support, installed to /usr/local, and will only cause confusion. Instead, install Perl 5.8 from pkgsrc (or from a @@ -678,21 +679,21 @@ pkgsrc, note the following things. * To uninstall UNIX Perl, use Add/Remove Programs, select Microsoft Windows Services for UNIX, then click Change. In the installer, choose Add or Remove, then uncheck Utilities->UNIX Perl. - + * To enable case-sensitivity for the filesystem, run REGEDIT.EXE, and change the following registry key: - + HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel - + Set the DWORD value "obcaseinsensitive" to 0; then reboot. - + * To enable setuid binaries (optional), run REGEDIT.EXE, and change the following registry key: - + HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Services for UNIX - + Set the DWORD value "EnableSetuidBinaries" to 1; then reboot. - + 3.2.3.3. Important notes for using pkgsrc The package imanager (either the pkgsrc "su" user, or the user running @@ -751,27 +752,27 @@ with the OpenBSD userland tools. There are several steps: 1. OpenBSD stores its ports pkg database in /var/db/pkg. It is therefore recommended that you choose a different location (e.g. /usr/pkgdb) by using the --pkgdbdir option to the bootstrap script. - + 2. If you do not intend to use the OpenBSD ports tools, it's probably a good idea to move them out of the way to avoid confusion, e.g. - + # cd /usr/sbin # mv pkg_add pkg_add.orig # mv pkg_create pkg_create.orig # mv pkg_delete pkg_delete.orig # mv pkg_info pkg_info.orig - + 3. An example /etc/mk.conf file will be placed in /etc/mk.conf.example file when you use the bootstrap script. OpenBSD's make program uses /etc/mk.conf as well. You can work around this by enclosing all the pkgsrc specific parts of the file with: - + .ifdef BSD_PKG_MK # pkgsrc stuff, e.g. insert bsd.pkg.defaults.mk or similar here .else # OpenBSD stuff .endif - + 3.2.6. Solaris @@ -782,15 +783,15 @@ The following packages are required on Solaris 8 for the bootstrap process and to build packages. * SUNWsprot - + * SUNWarc - + * SUNWbtool - + * SUNWtoo - + * SUNWlibm - + Please note the use of GNU binutils on Solaris is not supported. 3.2.6.1. If you are using gcc @@ -810,13 +811,13 @@ freewareSearch.html. You will need at least the following packages installed (from WorkShop 5.0) * SPROcc - Sun WorkShop Compiler C 5.0 - + * SPROcpl - Sun WorkShop Compiler C++ 5.0 - + * SPROild - Sun WorkShop Incremental Linker - + * SPROlang - Sun WorkShop Compilers common components - + You should set CC, CXX and optionally, CPP in /etc/mk.conf, eg. CC= cc @@ -835,18 +836,18 @@ Chapter 4. Using pkgsrc Table of Contents 4.1. Working with binary packages - + 4.1.1. Where to get binary packages 4.1.2. How to use binary packages 4.1.3. A word of warning - + 4.2. Building packages from source - + 4.2.1. Requirements 4.2.2. Fetching distfiles 4.2.3. How to build and install 4.2.4. Selecting the compiler - + 4.1. Working with binary packages This section describes how to find, retrieve and install a precompiled binary @@ -908,7 +909,7 @@ 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 +packages system to be able to build it. If it does not exist, pkgsrc will use ftp(1) to fetch it automatically. You can overwrite some of the major distribution sites to fit to sites that are @@ -968,21 +969,21 @@ added to help with this. 1. If you invoke the make(1) command with PKG_DEBUG_LEVEL=2, then a huge amount of information will be displayed. For example, - + make patch PKG_DEBUG_LEVEL=2 - + will show all the commands that are invoked, up to and including the "patch" stage. - + 2. If you want to know the value of a certain make(1) definition, then the VARNAME definition should be used, in conjunction with the show-var target. e.g. to show the expansion of the make(1) variable DISTFILES: - + % make show-var VARNAME=LOCALBASE /usr/pkg % - - + + If you want to install a binary package that you've either created yourself (see next section), that you put into pkgsrc/packages manually or that is @@ -1007,32 +1008,32 @@ By default, pkgsrc will use GCC to build packages. This may be overridden by setting the following variables in /etc/mk.conf: PKGSRC_COMPILER: - + This is a list of values specifying the chain of compilers to invoke when building packages. Valid values are: - + * distcc: distributed C/C++ (chainable) - + * ccache: compiler cache (chainable) - + * gcc: GNU C/C++ Compiler - + * mipspro: Silicon Graphics, Inc. MIPSpro (n32/n64) - + * mipspro: Silicon Graphics, Inc. MIPSpro (o32) - + * sunpro: Microsystems, Inc. WorkShip/Forte/Sun ONE Studio - + The default is "gcc". You can use ccache and/or distcc with an appropriate PKGSRC_COMPILER setting, e.g. "ccache gcc". This variable should always be terminated with a value for a real compiler. - + GCC_REQD: - + This specifies the minimum version of GCC to use when building packages. If the system GCC doesn't satisfy this requirement, then pkgsrc will build and install one of the GCC packages to use instead. - + Chapter 5. Creating binary packages Table of Contents @@ -1040,7 +1041,7 @@ Table of Contents 5.1. Building a single binary package 5.2. Settings for creation of binary packages 5.3. Doing a bulk build of all packages - + 5.3.1. Configuration 5.3.2. Other environmental considerations 5.3.3. Operation @@ -1048,11 +1049,11 @@ Table of Contents 5.3.5. Disk space requirements 5.3.6. Setting up a sandbox for chroot'ed builds 5.3.7. Building a partial set of packages - + 5.4. Creating a multiple CD-ROM packages collection - + 5.4.1. Example of cdpack - + 5.1. Building a single binary package Once you have built and installed a package, you can create a binary package @@ -1132,7 +1133,7 @@ nearly 3 GB of disk space. As /usr/pkg will be completely deleted at the start of bulk builds, make sure your login shell is placed somewhere else. Either drop it into /usr/local/bin -(and adjust your login shell in the passwd file), or (re-)install it via +(and adjust your login shell in the passwd file), or (re-)install it via pkg_add(1) from /etc/rc.local, so you can login after a reboot (remember that your current process won't die if the package is removed, you just can't start any new instances of the shell any more). Also, if you use NetBSD earlier than @@ -1175,22 +1176,22 @@ logs in the directory specified by FTP in the build.conf file. The bulk builds consist of three steps: 1. pre-build - + The script updates your pkgsrc tree via (anon)cvs, then cleans out any broken distfiles, and removes all packages installed. - + 2. the bulk build - + This is basically "make bulk-package" with an optimised order in which packages will be built. Packages that don't require other packages will be built first, and packages with many dependencies will be built later. - + 3. post-build - + Generates a report that's placed in the directory specified in the build.conf file named broken.html, a short version of that report will also be mailed to the build's admin. - + During the build, a list of broken packages will be compiled in /usr/pkgsrc /.broken (or .../.broken.${MACHINE} if OBJMACHINE is set), individual build logs of broken builds can be found in the package's directory. These files are @@ -1202,11 +1203,11 @@ rebuild them, and they can be used to debug these broken package builds later. Currently, roughly the following requirements are valid for NetBSD 2.0/i386: * 10 GB - distfiles (NFS ok) - + * 8 GB - full set of all binaries (NFS ok) - + * 5 GB - temp space for compiling (local disk recommended) - + Note that all pkgs will be de-installed as soon as they are turned into a binary package, and that sources are removed, so there is no excessively huge demand to disk space. Afterwards, if the package is needed again, it will be @@ -1225,56 +1226,56 @@ distribution DESTDIR=/usr/sandbox in /usr/src/etc, be sure the following items are present and properly configured: 1. Kernel - + # cp /netbsd /usr/sandbox - + 2. /dev/* - + # cd /usr/sandbox/dev ; sh MAKEDEV all - + 3. /etc/resolv.conf (for security/smtpd and mail): - + # cp /etc/resolv.conf /usr/sandbox/etc - + 4. Working(!) mail config (hostname, sendmail.cf): - + # cp /etc/mail/sendmail.cf /usr/sandbox/etc/mail - + 5. /etc/localtime (for security/smtpd): - + # ln -sf /usr/share/zoneinfo/UTC /usr/sandbox/etc/localtime - + 6. /usr/src (system sources, for sysutils/aperture, net/ppp-mppe): - + # ln -s ../disk1/cvs . # ln -s cvs/src-1.6 src - + 7. Create /var/db/pkg (not part of default install): - + # mkdir /usr/sandbox/var/db/pkg - + 8. Create /usr/pkg (not part of default install): - + # mkdir /usr/sandbox/usr/pkg - + 9. Checkout pkgsrc via cvs into /usr/sandbox/usr/pkgsrc: - + # cd /usr/sandbox/usr # cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -d -P pkgsrc - + Do not mount/link this to the copy of your pkgsrc tree you do development in, as this will likely cause problems! - + 10. Make /usr/sandbox/usr/pkgsrc/packages and .../distfiles point somewhere appropriate. NFS- and/or nullfs-mounts may come in handy! - + 11. Edit /etc/mk.conf, see Section 5.3.1.1, "/etc/mk.conf". - + 12. Adjust mk/bulk/build.conf to suit your needs. - + 13. If you have set CVS_USER in build.conf, make sure that account exists and can do a cvs ${CVS_FLAGS} update properly! - + When the chroot sandbox is setup, you can start the build with the following steps: @@ -1293,13 +1294,13 @@ In addition to building a complete set of all packages in pkgsrc, the pkgsrc/mk pkgsrc. By setting defining SPECIFIC_PKGS in /etc/mk.conf, the variables * SITE_SPECIFIC_PKGS - + * HOST_SPECIFIC_PKGS - + * GROUP_SPECIFIC_PKGS - + * USER_SPECIFIC_PKGS - + will define the set of packages which should be built. The bulk build code will also include any packages which are needed as dependencies for the explicitly listed packages. @@ -1359,8 +1360,8 @@ Table of Contents 6.7. How to fetch files from behind a firewall 6.8. How do I tell make fetch to do passive FTP? 6.9. How to fetch all distfiles at once -6.10. What does Don't know how to make /usr/share/tmac/tmac.andoc mean? -6.11. What does Could not find bsd.own.mk mean? +6.10. What does "Don't know how to make /usr/share/tmac/tmac.andoc" mean? +6.11. What does "Could not find bsd.own.mk" mean? 6.12. Using 'sudo' with pkgsrc 6.13. Configuration files handling and placement 6.14. Automated security checks @@ -1393,65 +1394,65 @@ duplicate the documentation that comes with each package. Utilities used by pkgsrc (automatically installed when needed): * pkgtools/x11-links: symlinks for use by buildlink - + OS tool augmentation (automatically installed when needed): * pkgtools/digest: calculates SHA1 checksums (and other kinds) - + * pkgtools/libnbcompat: compat library for pkg tools - + * pkgtools/mtree: installed on non-BSD systems due to lack of native mtree - + * pkgtools/pkg_install: up-to-date replacement for /usr/sbin/pkg_install, or for use on operating systems where pkg_install is not present - + 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 - + * pkgtools/dfdisk: adds extra functionality to pkgsrc, allowing it to fetch distfiles from multiple locations. It currently supports the following methods: multiple CD-ROMs and network FTP/HTTP connections. - + * pkgtools/xpkgwedge: put X11 packages someplace else (enabled by default) - + * devel/cpuflags: will determine the best compiler flags to optimise code for your current CPU and compiler. - + 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/pkgdep: makes dependency graphs of packages, to aid in choosing a strategy for updating - + * pkgtools/pkgdepgraph: make graph from above (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/pkgsurvey: report what packages you have installed - + Utilities for people maintaining or creating individual packages: * pkgtools/pkgdiff: automate making and maintaining patches for a package (includes pkgdiff, pkgvi, mkpatches, ...) - + * pkgtools/rpm2pkg, pkgtools/url2pkg: aids in converting to pkgsrc - + * pkgtools/gensolpkg: convert pkgsrc to a Solaris package - + Utilities for people maintaining pkgsrc (or more obscure pkg utilities) * pkgtools/pkgconflict: find packages that conflict but aren't marked as such - + * pkgtools/pkg_comp: build packages in a chrooted area - + * pkgtools/libkver: spoof kernel version for chrooted cross builds - + 6.4. How to use pkgsrc as non-root If you want to use pkgsrc as non-root user, you can set some variables to make @@ -1464,7 +1465,7 @@ X11R6, /usr/openwin, ...), you will have to add the following lines into mk.conf: X11_TYPE=XFree86 - + 6.6. How can I install/use X.org from pkgsrc? @@ -1473,7 +1474,7 @@ X11R6, /usr/openwin, ...) you will have to add the following lines into mk.conf: X11_TYPE=xorg - + 6.7. How to fetch files from behind a firewall @@ -1570,7 +1571,7 @@ binary package or from security/sudo) and then put the following into your /etc .if exists(/usr/pkg/bin/sudo) SU_CMD=/usr/pkg/bin/sudo /bin/sh -c .endif - + 6.13. Configuration files handling and placement @@ -1588,24 +1589,24 @@ customized in various ways: 1. PKG_SYSCONFBASE is the main config directory under which all package configuration files are to be found. Users will typically want to set it to /etc, or accept the default location of $PREFIX/etc. - + 2. PKG_SYSCONFSUBDIR is the subdirectory of PKG_SYSCONFBASE under which the configuration files for a particular package may be found. Defaults to $ {SYSCONFBASE}. - + 3. PKG_SYSCONFVAR is the special suffix used to distinguish any overriding values for a particular package (see next item). It defaults to ${PKGBASE}, but for a collection of related packages that should all have the same PKG_SYSCONFDIR value, it can be set in each of the package Makefiles to a common value. - + 4. PKG_SYSCONFDIR.${PKG_SYSCONFVAR} overrides the value of ${PKG_SYSCONFDIR} for packages with the same value for PKG_SYSCONFVAR. - + As an example, all the various KDE packages may want to set PKG_SYSCONFVAR to "kde" so admins can set PKG_SYSCONFDIR.kde in /etc/mk.conf to define where to install KDE config files. - + Programs' configuration directory should be defined during the configure stage. Packages that use GNU autoconf can usually do this by using the "--sysconfdir" parameter, but this brings some problems as we will see now. When you change @@ -1648,14 +1649,14 @@ packages installed on a system can take place. To do this, install the security security vulnerabilities information. This list is kept up to date by the NetBSD security officer and the NetBSD packages team, and is distributed from the NetBSD ftp server: - + ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/pkg-vulnerabilities - + 2. "audit-packages", an easy way to audit the current machine, checking each vulnerability which is known. If a vulnerable package is installed, it will be shown by output to stdout, including a description of the type of vulnerability, and a URL containing more information. - + Use of the audit-packages package is strongly recommended! The following message is displayed as part of the audit-packages installation @@ -1683,14 +1684,14 @@ if [ -x ${PREFIX}/sbin/audit-packages ]; then fi =========================================================================== - + The pkgsrc developer's guide Table of Contents 7. Package components - files, directories and contents - + 7.1. Makefile 7.2. distinfo 7.3. patches/* @@ -1698,9 +1699,9 @@ Table of Contents 7.5. Optional files 7.6. work* 7.7. files/* - + 8. PLIST issues - + 8.1. RCS ID 8.2. Semi-automatic PLIST generation 8.3. Tweaking output of make print-PLIST @@ -1709,35 +1710,35 @@ Table of Contents 8.6. Changing PLIST source with PLIST_SRC 8.7. Platform specific and differing PLISTs 8.8. Sharing directories between packages - + 9. Buildlink methodology - + 9.1. Converting packages to use buildlink3 9.2. Writing buildlink3.mk files - + 9.2.1. Anatomy of a buildlink3.mk file 9.2.2. Updating BUILDLINK_DEPENDS.pkg in buildlink3.mk files - + 9.3. Writing builtin.mk files - + 9.3.1. Anatomy of a builtin.mk file 9.3.2. Global preferences for native or pkgsrc software - + 10. Options handling - + 10.1. Global default options 10.2. Converting packages to use bsd.options.mk - + 11. The build process - + 11.1. Program location 11.2. Main targets 11.3. Other helpful targets - + 12. Notes on fixes for packages - + 12.1. General operation - + 12.1.1. How to pull in variables from /etc/mk.conf 12.1.2. Restricted packages 12.1.3. Handling dependencies @@ -1749,24 +1750,24 @@ Table of Contents 12.1.9. How to handle incrementing versions when fixing an existing package 12.1.10. Portability of packages - + 12.2. Possible downloading issues - + 12.2.1. Packages whose distfiles aren't available for plain downloading 12.2.2. How to handle modified distfiles with the 'old' name - + 12.3. Configuration gotchas - + 12.3.1. Shared libraries - libtool 12.3.2. Using libtool on GNU packages that already support libtool 12.3.3. GNU Autoconf/Automake - + 12.4. Building considerations - + 12.4.1. CPP defines - + 12.5. Package specific actions - + 12.5.1. Package configuration files 12.5.2. User interaction 12.5.3. Handling licenses @@ -1784,17 +1785,17 @@ Table of Contents 12.5.15. Packages installing SGML or XML data 12.5.16. Packages installing extensions to the MIME database 12.5.17. Packages using intltool - + 12.6. Feedback to the author - + 13. Debugging 14. Submitting and Committing - + 14.1. Submitting your packages 14.2. Committing: Importing a package into CVS 14.3. Updating a package to a newer version 14.4. Moving a package in pkgsrc - + Chapter 7. Package components - files, directories and contents Table of Contents @@ -1844,7 +1845,7 @@ The MASTER_SITES may be set to one of the predefined sites: ${MASTER_SITE_SUSE} ${MASTER_SITE_TEX_CTAN} ${MASTER_SITE_XCONTRIB} - ${MASTER_SITE_XEMACS} + ${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 @@ -1852,7 +1853,7 @@ one actual site, you must use the following construct to specify a subdirectory: ${MASTER_SITE_GNU:=subdirectory/name/} - ${MASTER_SITE_SOURCEFORGE:=project_name/} + ${MASTER_SITE_SOURCEFORGE:=project_name/} Note the trailing slash after the subdirectory name. @@ -1888,22 +1889,22 @@ Please pay attention to the following gotchas: * Add MANCOMPRESSED if manpages are installed in compressed form by the package; see comment in bsd.pkg.mk. - + * Replace /usr/local with "${PREFIX}" in all files (see patches, below). - + * If the package installs any info files, see Section 12.5.10, "Packages installing info files". - + * Set MAINTAINER to be yourself. If you really can't maintain the package for future updates, set it to <tech-pkg@NetBSD.org>. - + * If a home page for the software in question exists, add the variable HOMEPAGE right after MAINTAINER. The value of this variable should be the URL for the home page. - + * Be sure to set the COMMENT variable to a short description of the package, not containing the pkg's name. - + 7.2. distinfo Most important, the mandatory message digest, or checksum, of all the distfiles @@ -1915,7 +1916,7 @@ digest algorithm used was, at one stage, md5, but that was felt lacking compared to sha1, and so sha1 is now the default algorithm. The distfile size is also generated and stored in new distinfo files. The pkgtools/digest utility calculates all of the digests in the distinfo file, and it provides various -different algorithms. At the current time, the algorithms provided are: md5, +different algorithms. At the current time, the algorithms provided are: md5, rmd160, sha1, sha256, sha384 and sha512. Some packages have different sets of distfiles on a per architecture basis, for @@ -1954,9 +1955,9 @@ these problems. For even more automation, we recommend using mkpatches from the same package to make a whole set of patches. You just have to backup files before you edit them -to filename.orig, e.g. with cp -p filename filename.orig or, easier, by using +to filename.orig, e.g. with cp -p filename filename.orig or, easier, by using pkgvi again from the same package. If you upgrade a package this way, you can -easily compare the new set of patches with the previously existing one with +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 @@ -1978,50 +1979,50 @@ after pkgsrc patches are applied. 7.4. Other mandatory files DESCR - + A multi-line description of the piece of software. This should include any credits where they are due. Please bear in mind that others do not share your sense of humour (or spelling idiosyncrasies), and that others will read everything that you write here. - + PLIST - + This file governs the files that are installed on your system: all the binaries, manual pages, etc. There are other directives which may be entered in this file, to control the creation and deletion of directories, and the location of inserted files. See Chapter 8, PLIST issues for more information. - + 7.5. Optional files INSTALL - + This shell script is invoked twice by pkg_add(1). First time after package extraction and before files are moved in place, the second time after the files to install are moved in place. This can be used to do any custom - procedures not possible with @exec commands in PLIST. See pkg_add(1) and + procedures not possible with @exec commands in PLIST. See pkg_add(1) and pkg_create(1) for more information. - + DEINSTALL - + This script is executed before and after any files are removed. It is this script's responsibility to clean up any additional messy details around the package's installation, since all pkg_delete knows is how to delete the - files created in the original distribution. See pkg_delete(1) and + files created in the original distribution. See pkg_delete(1) and pkg_create(1) for more information. - + MESSAGE - + Display this file after installation of the package. Useful for things like legal notices on almost-free software and hints for updating config files after installing modules for apache, PHP etc. Please note that you can modify variables in it easily by using MESSAGE_SUBST in the package's Makefile: - + MESSAGE_SUBST+= SOMEVAR="somevalue" - + replaces "${SOMEVAR}" with "somevalue" in MESSAGE. - + 7.6. work* When you type make the distribution files are unpacked into this directory. It @@ -2102,13 +2103,13 @@ For example, to get all files inside the libdata/foo directory removed from the resulting PLIST: PRINT_PLIST_AWK+= /^libdata\/foo/ { next; } - + And to get all the @dirrm lines referring to a specific (shared) directory converted to @comments: PRINT_PLIST_AWK+= /^@dirrm share\/specific/ { print "@comment " $$0; next; } - + 8.4. Variable substitution in PLIST @@ -2116,7 +2117,7 @@ A number of variables are substituted automatically in PLISTs when a package is installed on a system. This includes the following variables: ${MACHINE_ARCH}, ${MACHINE_GNU_ARCH} - + Some packages like emacs and perl embed information about which architecture they were built on into the pathnames where they install their file. To handle this case, PLIST will be preprocessed before actually used, @@ -2124,30 +2125,30 @@ ${MACHINE_ARCH}, ${MACHINE_GNU_ARCH} The same is done if the string ${MACHINE_GNU_ARCH} is embedded in PLIST somewhere - use this on packages that have GNU autoconf created configure scripts. - + Legacy note - + There used to be a symbol "$ARCH" that was replaced by the output of uname -m, but that's no longer supported and has been removed. - + ${OPSYS}, ${LOWER_OPSYS}, ${OS_VERSION} - + Some packages want to embed the OS name and version into some paths. To do this, use these variables in the PLIST: - + * ${OPSYS} - output of "uname -s" - + * ${LOWER_OPSYS} - lowercase common name (eg. "solaris") - + * ${OS_VERSION} - "uname -r" - + ${PKGLOCALEDIR} - + Packages that install locale files should list them in the PLIST as "$ {PKGLOCALEDIR}/locale/de/LC_MESSAGES/..." instead of "share/locale/de/ LC_MESSAGES/...". This properly handles the fact that different operating systems expect locale files to be either in share or lib by default. - + For a complete list of values which are replaced by default, please look in bsd.pkg.mk (and search for PLIST_SUBST). @@ -2180,11 +2181,11 @@ system being used. These differences can be automatically handled by using the following files: * PLIST.common - + * PLIST.${OPSYS} - + * PLIST.common_end - + If PLIST.${OPSYS} exists, these files are used instead of PLIST. This allows packages which behave in this way to be handled gracefully. Manually overriding PLIST_SRC for other more exotic uses is also possible. @@ -2201,7 +2202,7 @@ unrelated packages, it's often not worth to add an extra package to remove it. Therefore, one simply does: @unexec ${RMDIR} %D/path/to/shared/directory 2>/dev/null || ${TRUE} - + in the PLISTs of all affected packages, instead of the regular "@dirrm" line. @@ -2211,16 +2212,16 @@ solutions are available: 1. If the packages have a common dependency, the directory can be removed in that. For example, see textproc/scrollkeeper, which removes the shared directory share/omf. - + 2. If the packages using the directory are not related at all (they have no common dependencies), a *-dirs package is used. - + From now on, we'll discuss the second solution. To get an idea of the *-dirs packages available, issue: % cd .../pkgsrc % ls -d */*-dirs - + Their use from other packages is very simple. The USE_DIRS variable takes a list of package names (without the "-dirs" part) together with the required @@ -2230,7 +2231,7 @@ For example, if a package installs files under share/applications, it should have the following line in it: USE_DIRS+= xdg-1.1 - + After regenerating the PLIST using make print-PLIST, you should get the right (commented out) lines. @@ -2245,28 +2246,28 @@ Table of Contents 9.1. Converting packages to use buildlink3 9.2. Writing buildlink3.mk files - + 9.2.1. Anatomy of a buildlink3.mk file 9.2.2. Updating BUILDLINK_DEPENDS.pkg in buildlink3.mk files - + 9.3. Writing builtin.mk files - + 9.3.1. Anatomy of a builtin.mk file 9.3.2. Global preferences for native or pkgsrc software - + Buildlink is a framework in pkgsrc that controls what headers and libraries are seen by a package's configure and build processes. This is implemented in a two step process: 1. Symlink headers and libraries for dependencies into BUILDLINK_DIR, which by default is a subdirectory of WRKDIR. - + 2. Create wrapper scripts that are used in place of the normal compiler tools that translate -I${LOCALBASE}/include and -L${LOCALBASE}/lib into references to BUILDLINK_DIR. The wrapper scripts also make native compiler on some operating systems look like GCC, so that packages that expect GCC won't require modifications to build with those native compilers. - + This normalizes the environment in which a package is built so that the package may be built consistently despite what other software may be installed. Please note that the normal system header and library paths, e.g. /usr/include, /usr/ @@ -2279,19 +2280,19 @@ The process of converting packages to use the buildlink3 framework ("bl3ifying") is fairly straightforward. The things to keep in mind are: 1. Set USE_BUILDLINK3 to "yes". - + 2. Ensure that the build always calls the wrapper scripts instead of the actual toolchain. Some packages are tricky, and the only way to know for sure is the check ${WRKDIR}/.work.log to see if the wrappers are being invoked. - + 3. Don't override PREFIX from within the package Makefile, e.g. Java VMs, standalone shells, etc., because the code to symlink files into $ {BUILDLINK_DIR} looks for files relative to "pkg_info -qp pkgname". - + 4. Remember that only the buildlink3.mk files that you list in a package's Makefile are added as dependencies for that package. - + If a dependency on a particular package is required for its libraries and headers, then we replace: @@ -2306,29 +2307,29 @@ issues: * bdb.buildlink3.mk chooses either the native or a pkgsrc Berkeley DB implementation based on the values of BDB_ACCEPTED and BDB_DEFAULT. - + * curses.buildlink3.mk If the system comes with neither Curses nor NCurses, this will take care to install the devel/ncurses package. - + * krb5.buildlink3.mk uses the value of KRB5_ACCEPTED to choose between adding a dependency on Heimdal or MIT-krb5 for packages that require a Kerberos 5 implementation. - + * motif.buildlink3.mk checks for a system-provided Motif installation or adds a dependency on x11/lesstif or x11/openmotif; - + * ossaudio.buildlink3.mk defines several variables that may be used by packages that use the Open Sound System (OSS) API; - + * pgsql.buildlink3.mk will accept either Postgres 7.3 or 7.4, whichever is found installed. See the file for more information. - + * pthread.buildlink3.mk uses the value of PTHREAD_OPTS and checks for native pthreads or adds a dependency on devel/pth as needed; - + * xaw.buildlink3.mk uses the value of XAW_TYPE to choose a particular Athena widgets library. - + The comments in those buildlink3.mk files provide a more complete description of how to use them properly. @@ -2340,7 +2341,7 @@ buildlink3.mk file should always provide enough information to add the correct type of dependency relationship and include any other buildlink3.mk files that it needs to find headers and libraries that it needs in turn. -To generate an initial buildlink3.mk file for further editing, Rene Hexel's +To generate an initial buildlink3.mk file for further editing, Rene Hexel's pkgtools/createbuildlink package is highly recommended. For most packages, the following command will generate a good starting point for buildlink3.mk files: @@ -2372,7 +2373,7 @@ BUILDLINK_PKGSRCDIR.tiff?= ../../graphics/tiff .include "../../devel/zlib/buildlink3.mk" .include "../../graphics/jpeg/buildlink3.mk" -BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} The header and footer manipulate BUILDLINK_DEPTH, which is common across all buildlink3.mk files and is used to track at what depth we are including @@ -2389,28 +2390,28 @@ within a buildlink3.mk file. The third section is protected from multiple inclusion and controls how the dependency on pkg is added. Several important variables are set in the section: - * BUILDLINK_DEPENDS. pkg is the actual dependency recorded in the installed + * BUILDLINK_DEPENDS.pkg is the actual dependency recorded in the installed package; this should always be set using += to ensure that we're appending to any pre-existing list of values. This variable should be set to the first version of the package that had the last change in the major number of a shared library or that had a major API change. - + * BUILDLINK_PKGSRCDIR.pkg is the location of the pkg pkgsrc directory; - + * BUILDLINK_DEPMETHOD.pkg (not shown above) controls whether we use BUILD_DEPENDS or DEPENDS to add the dependency on pkg. The build dependency is selected by setting BUILDLINK_DEPMETHOD.pkg to "build". By default, the full dependency is used. - - * BUILDLINK_INCDIRS. pkg and BUILDLINK_LIBDIRS.pkg (not shown above) are + + * BUILDLINK_INCDIRS.pkg and BUILDLINK_LIBDIRS. pkg (not shown above) are lists of subdirectories of ${BUILDLINK_PREFIX.pkg} to add to the header and library search paths. These default to "include" and "lib" respectively. - + * BUILDLINK_CPPFLAGS.pkg (not shown above) is the list of preprocessor flags to add to CPPFLAGS, which are passed on to the configure and build phases. The "-I" option should be avoided and instead be handled using BUILDLINK_INCDIRS.pkg as above. - + The following variables are all optionally defined within this second section (protected against multiple inclusion) and control which package files are symlinked into ${BUILDLINK_DIR} and how their names are transformed during the @@ -2419,24 +2420,24 @@ symlinking: * BUILDLINK_FILES.pkg (not shown above) is a shell glob pattern relative to $ {BUILDLINK_PREFIX.pkg} to be symlinked into ${BUILDLINK_DIR}, e.g. include/ *.h. - + * BUILDLINK_FILES_CMD.pkg (not shown above) is a shell pipeline that outputs to stdout a list of files relative to ${BUILDLINK_PREFIX.pkg}. The resulting files are to be symlinked into ${BUILDLINK_DIR}. By default, this takes the +CONTENTS of a pkg and filters it through $ {BUILDLINK_CONTENTS_FILTER.pkg}. - + * BUILDLINK_CONTENTS_FILTER.pkg (not shown above) is a filter command that filters +CONTENTS input into a list of files relative to $ {BUILDLINK_PREFIX.pkg} on stdout. By default for overwrite packages, BUILDLINK_CONTENTS_FILTER.pkg outputs the contents of the include and lib directories in the package +CONTENTS, and for pkgviews packages, it outputs any libtool archives in lib directories. - + * BUILDLINK_TRANSFORM.pkg (not shown above) is a list of sed arguments used to transform the name of the source filename into a destination filename, e.g. -e "s|/curses.h|/ncurses.h|g". - + The last section includes any buildlink3.mk needed for pkg's library dependencies. Including these buildlink3.mk files means that the headers and libraries for these dependencies are also symlinked into ${BUILDLINK_DIR} @@ -2449,15 +2450,16 @@ BUILDLINK_DEPENDS.pkg after a package update: 1. if the sonames (major number of the library version) of any installed shared libraries change; - + 2. if the API or interface to the header files change. - + In these cases, BUILDLINK_DEPENDS.pkg should be adjusted to require at least the new package version. In some cases, the packages that depend on this new version may need their PKGREVISIONs increased and, if they have buildlink3.mk -files, their BUILDLINK_DEPENDS.pkg adjusted, too. This is needed so that binary -packages made using it will require the correct package dependency and not -settle for an older one which will not contain the necessary shared libraries. +files, their BUILDLINK_DEPENDS. pkg adjusted, too. This is needed so that +binary packages made using it will require the correct package dependency and +not settle for an older one which will not contain the necessary shared +libraries. Please take careful consideration before adjusting BUILDLINK_DEPENDS.pkg as we don't want to cause unneeded package deletions and rebuilds. In many cases, new @@ -2477,13 +2479,13 @@ software is appropriate. The only requirements of a builtin.mk file for pkg are: 1. It should set USE_BUILTIN.pkg to either "yes" or "no" after it is included. - + 2. It should not override any USE_BUILTIN.pkg which is already set before the builtin.mk file is included. - + 3. It should be written to allow multiple inclusion. This is very important and takes careful attention to Makefile coding. - + 9.3.1. Anatomy of a builtin.mk file The following is the recommended template for builtin.mk files: @@ -2526,7 +2528,7 @@ CHECK_BUILTIN.foo?= no # "yes" or "no". # .endif # CHECK_BUILTIN.foo - + The first section sets IS_BUILTIN.pkg depending on if pkg really exists in the base system. This should not be a base system software with similar @@ -2540,13 +2542,13 @@ internally within the builtin.mk file. The third section sets USE_BUILTIN.pkg and is required in all builtin.mk files. The code in this section must make the determination whether the built-in -software is adequate to satisfy the dependencies listed in -BUILDLINK_DEPENDS.pkg. This is typically done by comparing BUILTIN_PKG.pkg -against each of the dependencies in BUILDLINK_DEPENDS.pkg. USE_BUILTIN.pkg must -be set to the correct value by the end of the builtin.mk file. Note that -USE_BUILTIN.pkg may be "yes" even if IS_BUILTIN.pkg is "no" because we may make -the determination that the built-in version of the software is similar enough -to be used as a replacement. +software is adequate to satisfy the dependencies listed in BUILDLINK_DEPENDS. +pkg. This is typically done by comparing BUILTIN_PKG.pkg against each of the +dependencies in BUILDLINK_DEPENDS.pkg. USE_BUILTIN.pkg must be set to the +correct value by the end of the builtin.mk file. Note that USE_BUILTIN.pkg may +be "yes" even if IS_BUILTIN.pkg is "no" because we may make the determination +that the built-in version of the software is similar enough to be used as a +replacement. The last section is guarded by CHECK_BUILTIN.pkg, and includes code that uses the value of USE_BUILTIN.pkg set in the previous section. This typically @@ -2569,7 +2571,7 @@ all but the most basic bits on a NetBSD system, you can set: PREFER_PKGSRC= yes PREFER_NATIVE= getopt skey tcp_wrappers - + A package must have a builtin.mk file to be listed in PREFER_NATIVE, otherwise it is simply ignored in that list. @@ -2635,7 +2637,7 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} . include "../../security/cyrus-sasl2/buildlink3.mk" CONFIGURE_ARGS+= --enable-sasl=${BUILDLINK_PREFIX.sasl} .endif - + The first section only exists if you are converting a package that had its own ad-hoc options handling to use bsd.options.mk. It converts global or legacy @@ -2649,35 +2651,35 @@ supported by the package, and any default options settings if needed. 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 option is always removed from the selected build options, e.g. - + PKG_DEFAULT_OPTIONS= kerberos ldap sasl PKG_OPTIONS_VAR= WIBBLE_OPTIONS WIBBLE_OPTIONS= ${PKG_DEFAULT_OPTIONS} -sasl # implies PKG_OPTIONS == "kerberos ldap" - - + + or - + PKG_OPTIONS_VAR= WIBBLE_OPTIONS WIBBLE_OPTIONS= kerberos -ldap ldap # implies PKG_OPTIONS == "kerberos" - - + + This variable should be set in /etc/mk.conf. - + After the inclusion of bsd.options.mk, the following variables are set: * PKG_OPTIONS contains the list of the selected build options, properly filtered to remove unsupported and duplicate options. - + The remaining sections contain the logic that is specific to each option. There should be a check for every option listed in PKG_SUPPORTED_OPTIONS, and there should be clear documentation on what turning on the option will do in the @@ -2718,102 +2720,102 @@ When choosing which of these variables to use, follow the following rules: * PREFIX always points to the location where the current pkg will be installed. When referring to a pkg's own installation path, use "${PREFIX} ". - + * LOCALBASE is where all non-X11 pkgs are installed. If you need to construct a -I or -L argument to the compiler to find includes and libraries installed by another non-X11 pkg, use "${LOCALBASE}". - + * X11BASE is where the actual X11 distribution (from xsrc, etc.) is installed. When looking for standard X11 includes (not those installed by a pkg), use "${X11BASE}". - + * X11 based are special in that they may be installed in either X11BASE or LOCALBASE. - + Usually, X11 packages should be installed under LOCALBASE whenever possible. Note that you will need to set USE_X11 in them to request the presence of X11 and to get the right compilation flags. - + Even though, there are some packages that cannot be installed under LOCALBASE: those that come with app-defaults files. These packages are special and they must be placed under X11BASE. To accomplish this, set either USE_X11BASE or USE_IMAKE in your package. - + Some notes: USE_X11 and USE_X11BASE are mutually exclusive. If you need to find includes or libraries installed by a pkg that has USE_IMAKE or USE_X11BASE in its pkg Makefile, you need to use both ${X11BASE} and $ - {LOCALBASE}. To force installation of all X11 packages in LOCALBASE, the + {LOCALBASE}. To force installation of all X11 packages in LOCALBASE, the pkgtools/xpkgwedge is enabled by default. - + * X11PREFIX should be used to refer to the installed location of an X11 package. X11PREFIX will be set to X11BASE if xpkgwedge is not installed, and to LOCALBASE if xpkgwedge is installed. - + * If xpkgwedge is installed, it is possible to have some packages installed in X11BASE and some in LOCALBASE. To determine the prefix of an installed package, the EVAL_PREFIX definition can be used. It takes pairs in the format "DIRNAME=<package>", and the make(1) variable DIRNAME will be set to the prefix of the installed package <package>, or "${X11PREFIX}" if the package is not installed. - + This is best illustrated by example. - + The following lines are taken from pkgsrc/wm/scwm/Makefile: - - EVAL_PREFIX+= GTKDIR=gtk+ + + EVAL_PREFIX+= GTKDIR=gtk+ CONFIGURE_ARGS+= --with-guile-prefix=${LOCALBASE} \ --with-gtk-prefix="${GTKDIR}" \ --enable-multibyte - + Specific defaults can be defined for the packages evaluated using EVAL_PREFIX, by using a definition of the form: - + GTKDIR_DEFAULT= ${LOCALBASE} - + where GTKDIR corresponds to the first definition in the EVAL_PREFIX pair. - + * Within ${PREFIX}, packages should install files according to hier(7), with the exception that manual pages go into ${PREFIX}/man, not ${PREFIX}/share/ man. - + 11.2. Main targets The main targets used during the build process defined in bsd.pkg.mk are: fetch - + This will check if the file(s) given in the variables DISTFILES and PATCHFILES (as defined in the package's Makefile) are present on the local system in /usr/pkgsrc/distfiles. If they are not present, an attempt will be made to fetch them using commands of the form: - + ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} - + where ${site} varies through several possibilities in turn: first, MASTER_SITE_OVERRIDE is tried, then the sites specified in either SITES_file if defined, else MASTER_SITES or PATCH_SITES, as applies, then finally the value of MASTER_SITE_BACKUP. The order of all except the first can be optionally sorted by the user, via setting either MASTER_SORT_AWK or MASTER_SORT_REGEX. - + checksum - + After the distfile(s) are fetched, their checksum is generated and compared with the checksums stored in the distinfo file. If the checksums don't match, the build is aborted. This is to ensure the same distfile is used for building, and that the distfile wasn't changed, e.g. by some malign force, deliberately changed distfiles on the master distribution site or network lossage. - + extract - + When the distfiles are present on the local system, they need to be extracted, as they are usually in the form of some compressed archive format, most commonly .tar.gz. - + If only some of the distfiles need to be uncompressed, the files to be uncompressed should be put into EXTRACT_ONLY. - + If the distfiles are not in .tar.gz format, they can be extracted by setting either EXTRACT_SUFX, or EXTRACT_CMD, EXTRACT_BEFORE_ARGS and EXTRACT_AFTER_ARGS. In the former case, pkgsrc knows how to extract a @@ -2822,68 +2824,68 @@ extract various DECOMPRESS_CMD variables bsd.pkg.mk for a complete list). Here's an example on how to use the other variables for a program that comes with a compressed shell archive whose name ends in .msg.gz: - + EXTRACT_SUFX= .msg.gz EXTRACT_CMD= zcat EXTRACT_BEFORE_ARGS= EXTRACT_AFTER_ARGS= |sh - + patch - + After extraction, all the patches named by the PATCHFILES, those present in the patches subdirectory of the package as well as in $LOCALPATCHES/ $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 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 apply cleanly. The rationale behind this is that patches that don't apply cleanly may end up being applied in the wrong place, and cause severe harm there. - + configure - + Most pieces of software need information on the header files, system calls, and library routines which are available in NetBSD. This is the process known as configuration, and is usually automated. In most cases, a script is supplied with the source, and its invocation results in generation of header files, Makefiles, etc. - + If the program's distfile contains its own configure script, this can be invoked by setting HAS_CONFIGURE. If the configure script is a GNU autoconf script, GNU_CONFIGURE should be specified instead. In either case, any arguments to the configure script can be specified in the CONFIGURE_ARGS variable, and the configure script's name can be set in CONFIGURE_SCRIPT if - it differs from the default "configure". Here's an example from the + it differs from the default "configure". Here's an example from the sysutils/top package: - + HAS_CONFIGURE= yes CONFIGURE_SCRIPT= Configure CONFIGURE_ARGS+= netbsd13 - + If the program uses an Imakefile for configuration, the appropriate steps can be invoked by setting USE_IMAKE to "YES". (If you only want the package installed in $X11PREFIX but xmkmf not being run, set USE_X11BASE instead!) - + build - + Once configuration has taken place, the software will be built by invoking $MAKE_PROGRAM on $MAKEFILE with $ALL_TARGET as the target to build. The - default MAKE_PROGRAM is "gmake" if USE_GMAKE is set, "make" otherwise. - MAKEFILE is set to "Makefile" by default, and ALL_TARGET defaults to "all". - Any of these variables can be set in the package's Makefile to change the - default build process. - + default MAKE_PROGRAM is "gmake" if USE_GNU_TOOLS contains "make", "make" + otherwise. MAKEFILE is set to "Makefile" by default, and ALL_TARGET + defaults to "all". Any of these variables can be set in the package's + Makefile to change the default build process. + install - + Once the build stage has completed, the final step is to install the software in public directories, so users can access the programs and files. As in the build-target, $MAKE_PROGRAM is invoked on $MAKEFILE here, but with the $INSTALL_TARGET instead, the latter defaulting to "install" (plus "install.man", if USE_IMAKE is set). - + If no target is specified, the default is "build". If a subsequent stage is requested, all prior stages are made: e.g. make build will also perform the equivalent of: @@ -2898,136 +2900,136 @@ make build 11.3. Other helpful targets pre/post-* - + For any of the main targets described in the previous section, two auxiliary targets exist with "pre-" and "post-" used as a prefix for the main target's name. These targets are invoked before and after the main target is called, allowing extra configuration or installation steps be performed from a package's Makefile, for example, which a program's configure script or install target omitted. - + do-* - + Should one of the main targets do the wrong thing, and should there be no variable to fix this, you can redefine it with the do-* target. (Note that redefining the target itself instead of the do-* target is a bad idea, as the pre-* and post-* targets won't be called anymore, etc.) You will not usually need to do this. - + reinstall - + If you did a make install and you noticed some file was not installed properly, you can repeat the installation with this target, which will ignore the "already installed" flag. - + deinstall - + This target does a pkg_delete(1) in the current directory, effectively de-installing the package. The following variables can be used to tune the behaviour: - + PKG_VERBOSE - + Add a "-v" to the pkg_delete(1) command. - + DEINSTALLDEPENDS - + Remove all packages that require (depend on) the given package. This can be used to remove any packages that may have been pulled in by a given package, e.g. if make deinstall DEINSTALLDEPENDS=1 is done in pkgsrc/x11/kde, this is likely to remove whole KDE. Works by adding "-R" to the pkg_delete(1) command line. - + update - + This target causes the current package to be updated to the latest version. The package and all depending packages first get de-installed, then current versions of the corresponding packages get compiled and installed. This is similar to manually noting which packages are currently installed, then performing a series of make deinstall and make install (or whatever UPDATE_TARGET is set to) for these packages. - + You can use the "update" target to resume package updating in case a previous make update was interrupted for some reason. However, in this case, make sure you don't call make clean or otherwise remove the list of dependent packages in WRKDIR. Otherwise you lose the ability to automatically update the current package along with the dependent packages you have installed. - + Resuming an interrupted make update will only work as long as the package tree remains unchanged. If the source code for one of the packages to be updated has been changed, resuming make update will most certainly fail! - + The following variables can be used either on the command line or in /etc/ mk.conf to alter the behaviour of make update: - + UPDATE_TARGET - + Install target to recursively use for the updated package and the dependent packages. Defaults to DEPENDS_TARGET if set, "install" otherwise for make update. e.g. make update UPDATE_TARGET=package - + NOCLEAN - + Don't clean up after updating. Useful if you want to leave the work sources of the updated packages around for inspection or other purposes. Be sure you eventually clean up the source tree (see the "clean-update" target below) or you may run into troubles with old source code still lying around on your next make or make update. - + REINSTALL - + Deinstall each package before installing (making DEPENDS_TARGET). This may be necessary if the "clean-update" target (see below) was called after interrupting a running make update. - + DEPENDS_TARGET - + Allows you to disable recursion and hardcode the target for packages. The default is "update" for the update target, facilitating a recursive update of prerequisite packages. Only set DEPENDS_TARGET if you want to disable recursive updates. Use UPDATE_TARGET instead to just set a specific target for each package to be installed during make update (see above). - + clean-update - + Clean the source tree for all packages that would get updated if make update was called from the current directory. This target should not be used if the current package (or any of its depending packages) have already been de-installed (e.g., after calling make update) or you may lose some - packages you intended to update. As a rule of thumb: only use this target + packages you intended to update. As a rule of thumb: only use this target before the first time you run make update and only if you have a dirty package tree (e.g., if you used NOCLEAN). - - If you unsure about whether your tree is clean you can either perform a + + If you unsure about whether your tree is clean you can either perform a make clean at the top of the tree, or use the following sequence of commands from the directory of the package you want to update (before running make update for the first time, otherwise you lose all the packages you wanted to update!): - + # make clean-update # make clean CLEANDEPENDS=YES # make update - + The following variables can be used either on the command line or in /etc/ mk.conf to alter the behaviour of make clean-update: - + CLEAR_DIRLIST - + After make clean, do not reconstruct the list of directories to update for this package. Only use this if make update successfully installed all packages you wanted to update. Normally, this is done automatically on make update, but may have been suppressed by the NOCLEAN variable (see above). - + info - + This target invokes pkg_info(1) for the current package. You can use this to check which version of a package is installed. - + readme - + This target generates a README.html file, which can be viewed using a browser such as www/mozilla or www/links. The generated files contain references to any packages which are in the PACKAGES directory on the local @@ -3037,106 +3039,106 @@ readme the directory /usr/packages, set FTP_PKG_URL_HOST=file://localhost and FTP_PKG_URL_DIR=/usr/packages. The ${PACKAGES} directory and its subdirectories will be searched for all the binary packages. - + readme-all - + Use this target to create a file README-all.html which contains a list of all packages currently available in the NetBSD Packages Collection, together with the category they belong to and a short description. This file is compiled from the pkgsrc/*/README.html files, so be sure to run this after a make readme. - + cdrom-readme - + This is very much the same as the "readme" target (see above), but is to be used when generating a pkgsrc tree to be written to a CD-ROM. This target also produces README.html files, and can be made to refer to URLs based on CDROM_PKG_URL_HOST and CDROM_PKG_URL_DIR. - + show-distfiles - + This target shows which distfiles and patchfiles are needed to build the package. (DISTFILES and PATCHFILES, but not patches/*) - + show-downlevel - + This target shows nothing if the package is not installed. If a version of this package is installed, but is not the version provided in this version of pkgsrc, then a warning message is displayed. This target can be used to show which of your installed packages are downlevel, and so the old versions can be deleted, and the current ones added. - + show-pkgsrc-dir - + This target shows the directory in the pkgsrc hierarchy from which the package can be built and installed. This may not be the same directory as the one from which the package was installed. This target is intended to be used by people who may wish to upgrade many packages on a single host, and can be invoked from the top-level pkgsrc Makefile by using the "show-host-specific-pkgs" target. - + show-installed-depends - + This target shows which installed packages match the current package's DEPENDS. Useful if out of date dependencies are causing build problems. - + check-shlibs - + After a package is installed, check all its binaries and (on ELF platforms) shared libraries to see if they find the shared libs they need. Run by default if PKG_DEVELOPER is set in /etc/mk.conf. - + print-PLIST - + After a "make install" from a new or upgraded pkg, this prints out an attempt to generate a new PLIST from a find -newer work/.extract_done. An attempt is made to care for shared libs etc., but it is strongly recommended to review the result before putting it into PLIST. On upgrades, it's useful to diff the output of this command against an already existing PLIST file. - + If the package installs files via tar(1) or other methods that don't update file access times, be sure to add these files manually to your PLIST, as the "find -newer" command used by this target won't catch them! - + See Section 8.3, "Tweaking output of make print-PLIST" for more information on this target. - + bulk-package - + Used to do bulk builds. If an appropriate binary package already exists, no action is taken. If not, this target will compile, install and package it (and it's depends, if PKG_DEPENDS is set properly. See Section 5.3.1, "Configuration". After creating the binary package, the sources, the just-installed package and it's required packages are removed, preserving free disk space. - + Beware that this target may deinstall all packages installed on a system! - + bulk-install - + Used during bulk-installs to install required packages. If an upto-date - binary package is available, it will be installed via pkg_add(1). If not, + binary package is available, it will be installed via pkg_add(1). If not, make bulk-package will be executed, but the installed binary not be removed. - + A binary package is considered "upto-date" to be installed via pkg_add(1) if: - + * None of the package's files (Makefile, ...) were modified since it was built. - + * None of the package's required (binary) packages were modified since it was built. - + Beware that this target may deinstall all packages installed on a system! - + Chapter 12. Notes on fixes for packages Table of Contents 12.1. General operation - + 12.1.1. How to pull in variables from /etc/mk.conf 12.1.2. Restricted packages 12.1.3. Handling dependencies @@ -3147,24 +3149,24 @@ Table of Contents 12.1.8. How to handle compiler bugs 12.1.9. How to handle incrementing versions when fixing an existing package 12.1.10. Portability of packages - + 12.2. Possible downloading issues - + 12.2.1. Packages whose distfiles aren't available for plain downloading 12.2.2. How to handle modified distfiles with the 'old' name - + 12.3. Configuration gotchas - + 12.3.1. Shared libraries - libtool 12.3.2. Using libtool on GNU packages that already support libtool 12.3.3. GNU Autoconf/Automake - + 12.4. Building considerations - + 12.4.1. CPP defines - + 12.5. Package specific actions - + 12.5.1. Package configuration files 12.5.2. User interaction 12.5.3. Handling licenses @@ -3182,7 +3184,7 @@ Table of Contents 12.5.15. Packages installing SGML or XML data 12.5.16. Packages installing extensions to the MIME database 12.5.17. Packages using intltool - + 12.6. Feedback to the author 12.1. General operation @@ -3201,7 +3203,7 @@ the package Makefile before any preprocessor-like .if, .ifdef, or .ifndef statements: .include "../../mk/bsd.prefs.mk" - + .if defined(USE_MENUS) ... .endif @@ -3221,34 +3223,34 @@ these restrictions, the package system defines five make variables that can be set to note these restrictions: * RESTRICTED - + This variable should be set whenever a restriction exists (regardless of its kind). Set this variable to a string containing the reason for the restriction. - + * NO_BIN_ON_CDROM - + Binaries may not be placed on CD-ROM. Set this variable to ${RESTRICTED} whenever a binary package may not be included on a CD-ROM. - + * NO_BIN_ON_FTP - + Binaries may not be placed on an FTP server. Set this variable to $ {RESTRICTED} whenever a binary package may not not be made available on the Internet. - + * NO_SRC_ON_CDROM - + Distfiles may not be placed on CD-ROM. Set this variable to ${RESTRICTED} if re-distribution of the source code or other distfile(s) is not allowed on CD-ROMs. - + * NO_SRC_ON_FTP - + Distfiles may not be placed on FTP. Set this variable to ${RESTRICTED} if re-distribution of the source code or other distfile(s) via the Internet is not allowed. - + Please note that the use of NO_PACKAGE, IGNORE, NO_CDROM, or other generic make variables to denote restrictions is deprecated, because they unconditionally prevent users from generating binary packages! @@ -3279,51 +3281,51 @@ version numbers recognised by pkg_info(1). 1. If your package needs another package's binaries or libraries to build or run, and if that package has a buildlink3.mk file available, use it: - + .include "../../graphics/jpeg/buildlink3.mk" - - + + 2. If your package needs to use another package to build itself and there is no buildlink3.mk file available, use the BUILD_DEPENDS definition: - + BUILD_DEPENDS+= autoconf-2.13:../../devel/autoconf - + 3. If your package needs a library with which to link and again there is no buildlink3.mk file available, this is specified using the DEPENDS definition. An example of this is the print/lyx package, which uses the xpm library, version 3.4j to build: - + DEPENDS+= xpm-3.4j:../../graphics/xpm - + You can also use wildcards in package dependences: - + DEPENDS+= xpm-[0-9]*:../../graphics/xpm - + Note that such wildcard dependencies are retained when creating binary packages. The dependency is checked when installing the binary package and any package which matches the pattern will be used. Wildcard dependencies should be used with care. - + The "-[0-9]*" should be used instead of "-*" to avoid potentially ambiguous matches such as "tk-postgresql" matching a "tk-*" DEPENDS. - + Wildcards can also be used to specify that a package will only build against a certain minimum version of a pre-requisite: - + DEPENDS+= tiff>=3.5.4:../../graphics/tiff - + This means that the package will build against version 3.5.4 of the tiff library or newer. Such a dependency may be warranted if, for example, the API of the library has changed with version 3.5.4 and a package would not compile against an earlier version of tiff. - + Please note that such dependencies should only be updated if a package requires a newer pre-requisite, but not to denote recommendations such as security updates or ABI changes that do not prevent a package from building correctly. Such recommendations can be expressed using RECOMMENDED: - + RECOMMENDED+= tiff>=3.6.1:../../graphics/tiff - + In addition to the above DEPENDS line, this denotes that while a package will build against tiff>=3.5.4, at least version 3.6.1 is recommended. RECOMMENDED entries will be turned into dependencies unless explicitly @@ -3331,21 +3333,21 @@ version numbers recognised by pkg_info(1). with recommendations ignored may not be uploaded to ftp.NetBSD.org by developers and should not be used across different systems that may have different versions of binary packages installed. - + For security fixes, please update the package vulnerabilities file as well as setting RECOMMENDED, see Section 12.1.7, "Handling packages with security problems" for more information. - + 4. If your package needs some executable to be able to run correctly and if there's agail no buildlink3.mk file, this is specified using the DEPENDS variable. The print/lyx package needs to be able to execute the latex binary from the teTeX package when it runs, and that is specified: - + DEPENDS+= teTeX-[0-9]*:../../print/teTeX - + The comment about wildcard dependencies from previous paragraph applies here, too. - + If your package needs files from another package to build, see the first part of the "do-configure" target print/ghostscript5 package (it relies on the jpeg sources being present in source form during the build): @@ -3511,7 +3513,7 @@ pkgsrc supports many different machines, with different object formats like a.out and ELF, and varying abilities to do shared library and dynamic loading at all. To accompany this, varying commands and options have to be passed to the compiler, linker, etc. to get the Right Thing, which can be pretty annoying -especially if you don't have all the machines at your hand to test things. The +especially if you don't have all the machines at your hand to test things. The devel/libtool pkg can help here, as it just "knows" how to build both static and dynamic libraries from a set of source files, thus being platform independent. @@ -3519,86 +3521,86 @@ independent. Here's how to use libtool in a pkg in seven simple steps: 1. Add USE_LIBTOOL=yes to the package Makefile. - + 2. For library objects, use "${LIBTOOL} --mode=compile ${CC}" in place of "$ {CC}". You could even add it to the definition of CC, if only libraries are being built in a given Makefile. This one command will build both PIC and non-PIC library objects, so you need not have separate shared and non-shared library rules. - + 3. For the linking of the library, remove any "ar", "ranlib", and "ld -Bshareable" commands, and instead use: - + ${LIBTOOL} --mode=link ${CC} -o ${.TARGET:.a=.la} ${OBJS:.o=.lo} -rpath ${PREFIX}/lib -version-info major:minor - + Note that the library is changed to have a .la extension, and the objects are changed to have a .lo extension. Change OBJS as necessary. This automatically creates all of the .a, .so.major.minor, and ELF symlinks (if necessary) in the build directory. Be sure to include "-version-info", especially when major and minor are zero, as libtool will otherwise strip off the shared library version. - + From the libtool manual: - + So, libtool library versions are described by three integers: - + CURRENT The most recent interface number that this library implements. - + REVISION The implementation number of the CURRENT interface. - + AGE The difference between the newest and oldest interfaces that this library implements. In other words, the library implements all the interface numbers in the range from number `CURRENT - AGE' to `CURRENT'. - + If two libraries have identical CURRENT and AGE numbers, then the - dynamic linker chooses the library with the greater REVISION number. - + dynamic linker chooses the library with the greater REVISION number. + The "-release" option will produce different results for a.out and ELF (excluding symlinks) in only one case. An ELF library of the form "libfoo-release.so.x.y" will have a symlink of "libfoo.so.x.y" on an a.out platform. This is handled automatically. - + The "-rpath argument" is the install directory of the library being built. - - In the PLIST, include all of the .a, .la, and .so, .so.major and - .so.major.minor files. - + + In the PLIST, include all of the .a, .la, and .so, .so.major and .so.major. + minor files. + 4. When linking shared object (.so) files, i.e. files that are loaded via dlopen(3), NOT shared libraries, use "-module -avoid-version" to prevent them getting version tacked on. - + The PLIST file gets the foo.so entry. - + 5. When linking programs that depend on these libraries before they are installed, preface the cc(1) or ld(1) line with "${LIBTOOL} --mode=link", and it will find the correct libraries (static or shared), but please be aware that libtool will not allow you to specify a relative path in -L (such as "-L../somelib"), because it expects you to change that argument to be the .la file. e.g. - + ${LIBTOOL} --mode=link ${CC} -o someprog -L../somelib -lsomelib - + should be changed to: - + ${LIBTOOL} --mode=link ${CC} -o someprog ../somelib/somelib.la - + and it will do the right thing with the libraries. - + 6. When installing libraries, preface the install(1) or cp(1) command with "$ {LIBTOOL} --mode=install", and change the library name to .la. e.g. - + ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib - + This will install the static .a, shared library, any needed symlinks, and run ldconfig(8). - + 7. In your PLIST, include all of the .a, .la, and .so, .so.CURRENT and .so.CURRENT.REVISION files (this is a change from the previous behaviour). - + 12.3.2. Using libtool on GNU packages that already support libtool Add USE_LIBTOOL=yes to the package Makefile. This will override the package's @@ -3624,15 +3626,15 @@ in some circumstances. Some of the more common errors are: * The inclusion of a shared object (-module) as a dependent library in an executable or library. This in itself isn't a problem if one of two things has been done: - + 1. The shared object is named correctly, i.e. libfoo.la, not foo.la - + 2. The -dlopen option is used when linking an executable. - + * The use of libltdl without the correct calls to initialisation routines. The function lt_dlinit() should be called and the macro LTDL_SET_PRELOADED_SYMBOLS included in executables. - + 12.3.3. GNU Autoconf/Automake If a package needs GNU autoconf or automake to be executed to regenerate the @@ -3711,19 +3713,19 @@ variables: * PKG_SYSCONFBASE is the main config directory under which all package configuration files are to be found. This defaults to ${PREFIX}/etc, but may be overridden in /etc/mk.conf. - + * PKG_SYSCONFSUBDIR is the subdirectory of PKG_SYSCONFBASE under which the configuration files for a particular package may be found, e.g. the Apache configuration files may all be found under the httpd/ subdirectory of $ {PKG_SYSCONFBASE}. This should be set in the package Makefile. - + * By default, PKG_SYSCONFDIR is set to ${PKG_SYSCONFBASE}/$ {PKG_SYSCONFSUBDIR}, but this may be overridden by setting PKG_SYSCONFDIR.$ {PKG_SYSCONFVAR} for a particular package, where PKG_SYSCONFVAR defaults to ${PKGBASE}. This is not meant to be set by a package Makefile, but is reserved for users who wish to override the PKG_SYSCONFDIR setting for a particular package with a special location. - + The only variables that users should customize are PKG_SYSCONFBASE and PKG_SYSCONFDIR.${PKG_SYSCONFVAR}. Users will typically want to set PKG_SYSCONFBASE to /etc, or to accept the default location of ${PREFIX}/etc. @@ -3734,13 +3736,13 @@ Occasionally, packages require interaction from the user, and this can be in a number of ways: * help in fetching the distfiles - + * help to configure the package before it is built - + * help during the build process - + * help during the installation of a package - + The INTERACTIVE_STAGE definition is provided to notify the pkgsrc mechanism of an interactive stage which will be needed, and this should be set in the package's Makefile. e.g. @@ -3898,12 +3900,12 @@ Some packages install info files or use the "makeinfo" or "install-info" commands. Each of the info files: * is considered to be installed in the directory ${PREFIX}/${INFO_DIR}, - + * is registered in the Info directory file ${PREFIX}/${INFO_DIR}/dir, - + * and must be listed as a filename in the INFO_FILES variable in the package Makefile. - + INFO_DIR defaults to "info" and can be overridden in the package Makefile. INSTALL and DEINSTALL scripts will be generated to handle registration of the info files in the Info directory file. The "install-info" command used for the @@ -3920,7 +3922,7 @@ automatically. The build and installation process of the software provided by the package should not use the install-info command as the registration of info files is -the task of the package INSTALL script, and it must use the appropriate +the task of the package INSTALL script, and it must use the appropriate makeinfo command. To achieve this goal the pkgsrc infrastructure creates overriding scripts for @@ -3941,23 +3943,23 @@ take some extra steps to make sure they get registered in the database: deinstallation time, and tells the package where to install GConf2 data files using some standard configure arguments. It also disallows any access to the database directly from the package. - + 2. Ensure that the package installs its .schemas files under ${PREFIX}/share/ gconf/schemas. If they get installed under ${PREFIX}/etc, you will need to manually patch the package. - + 3. Check the PLIST and remove any entries under the etc/gconf directory, as they will be handled automatically. See Section 6.13, "Configuration files handling and placement" for more information. - + 4. Define the GCONF2_SCHEMAS variable in your Makefile with a list of all .schemas files installed by the package, if any. Names must not contain any directories in them. - + 5. Define the GCONF2_ENTRIES variable in your Makefile with a list of all .entries files installed by the package, if any. Names must not contain any directories in them. - + 12.5.12. Packages installing scrollkeeper data files If a package installs .omf files, used by scrollkeeper, you need to take some @@ -3967,13 +3969,13 @@ extra steps to make sure they get registered in the database: file. This takes care of rebuilding the scrollkeeper database at installation and deinstallation time, and disallows any access to it directly from the package. - + 2. Check the PLIST and remove any entries under the libdata/scrollkeeper directory, as they will be handled automatically. - + 3. Remove the share/omf directory from the PLIST. It will be handled by scrollkeeper. - + 12.5.13. Packages installing X11 fonts If a package installs font files, you will need to rebuild the fonts database @@ -3998,21 +4000,21 @@ steps to get them registered in the GTK2 database properly: 1. Include ../../x11/gtk2/modules.mk instead of its buildlink3.mk file. This takes care of rebuilding the database at installation and deinstallation time. - + 2. Set GTK2_IMMODULES=YES if your package installs GTK2 immodules. - + 3. Set GTK2_LOADERS=YES if your package installs GTK2 loaders. - + 4. Patch the package to not touch any of the gtk2 databases directly. These are: - + * libdata/gtk-2.0/gdk-pixbuf.loaders - + * libdata/gtk-2.0/gtk.immodules - + 5. Check the PLIST and remove any entries under the libdata/gtk-2.0 directory, as they will be handled automatically. - + 12.5.15. Packages installing SGML or XML data If a package installs SGML or XML data files that need to be registered in @@ -4022,23 +4024,23 @@ extra steps: 1. Include ../../textproc/xmlcatmgr/catalogs.mk in your Makefile, which takes care of registering those files in system-wide catalogs at installation and deinstallation time. - + 2. Set SGML_CATALOGS to the full path of any SGML catalogs installed by the package. - + 3. Set XML_CATALOGS to the full path of any XML catalogs installed by the package. - + 4. Set SGML_ENTRIES to individual entries to be added to the SGML catalog. These come in groups of three strings; see xmlcatmgr(1) for more information (specifically, arguments recognized by the 'add' action). Note that you will normally not use this variable. - + 5. Set XML_ENTRIES to individual entries to be added to the XML catalog. These come in groups of three strings; see xmlcatmgr(1) for more information (specifically, arguments recognized by the 'add' action). Note that you will normally not use this variable. - + 12.5.16. Packages installing extensions to the MIME database If a package provides extensions to the MIME database by installing .xml files @@ -4050,16 +4052,16 @@ ensure that the database is kept consistent with respect to these new files: inclusion from other buildlink3.mk files). It takes care of rebuilding the MIME database at installation and deinstallation time, and disallows any access to it directly from the package. - - 2. Check the PLIST and remove any entries under the share/mime directory, + + 2. Check the PLIST and remove any entries under the share/mime directory, except for files saved under share/mime/packages. The former are handled automatically by the update-mime-database program, but the later are package-dependent and must be removed by the package that installed them in the first place. - + 3. Remove any share/mime/* directories from the PLIST. They will be handled by the shared-mime-info package. - + 12.5.17. Packages using intltool If a package uses intltool during its build, include the ../../textproc/ @@ -4088,25 +4090,25 @@ do in order to get a package working. Please note this is basically the same as what was explained in the previous sections, only with some debugging aids. * Be sure to set PKG_DEVELOPER=1 in /etc/mk.conf - + * Install pkgtools/url2pkg, create a directory for a new package, change into it, then run url2pkg: - + % mkdir /usr/pkgsrc/category/examplepkg % cd /usr/pkgsrc/category/examplepkg % url2pkg http://www.example.com/path/to/distfile.tar.gz - + * Edit the Makefile as requested. - + * Fill in the DESCR file - + * Run make configure - + * Add any dependencies glimpsed from documentation and the configure step to the package's Makefile. - + * Make the package compile, doing multiple rounds of - + % make % pkgvi ${WRKSRC}/some/file/that/does/not/compile % mkpatches @@ -4114,55 +4116,55 @@ what was explained in the previous sections, only with some debugging aids. % mv ${WRKDIR}/.newpatches/* patches % make mps % make clean - + Doing as non-root user will ensure that no files are modified that - shouldn't be, especially during the build phase. mkpatches, patchdiff and + 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 7.1, "Makefile". - + * Generate a PLIST: - + # make install # make print-PLIST >PLIST # make deinstall # make install # make deinstall - + You usually need to be root to do this. Look if there are any files left: - + # make print-PLIST - + If this reveals any files that are missing in PLIST, add them. - + * Now that the PLIST is OK, install the package again and make a binary package: - + # make reinstall # make package - + * Delete the installed package: - + # pkg_delete blub - + * Repeat the above make print-PLIST command, which shouldn't find anything now: - + # make print-PLIST - + * Reinstall the binary package: - + # pkgadd .../blub.tgz - + * Play with it. Make sure everything works. - + * Run pkglint from pkgtools/pkglint, and fix the problems it reports: - + # pkglint - + * Submit (or commit, if you have cvs access); see Chapter 14, Submitting and Committing. - + Chapter 14. Submitting and Committing Table of Contents @@ -4177,30 +4179,30 @@ Table of Contents You have to separate between binary and "normal" (source) packages here: * precompiled binary packages - + Our policy is that we accept binaries only from pkgsrc developers to guarantee that the packages don't contain any trojan horses etc. This is not to piss anyone off but rather to protect our users! You're still free to put up your home-made binary packages and tell the world where to get them. - + * packages - - First, check that your package is complete, compiles and runs well; see + + First, check that your package is complete, compiles and runs well; see Chapter 13, Debugging and the rest of this document. Next, generate an uuencoded gzipped tar(1) archive, preferably with all files in a single directory. Finally, send-pr with category "pkg", a synopsis which includes the package name and version number, a short description of your package (contents of the COMMENT variable or DESCR file are OK) and attach the archive to your PR. - + If you want to submit several packages, please send a separate PR for each one, it's easier for us to track things that way. - + Alternatively, you can also import new packages into pkgsrc-wip ("pkgsrc work-in-progress"); see the homepage at http://pkgsrc-wip.sourceforge.net/ for details. - + 14.2. Committing: Importing a package into CVS This section is only of interest for pkgsrc developers with write access to the @@ -4222,7 +4224,7 @@ so people reading the mailing lists know what the package is/does. Please note all package updates/additions in pkgsrc/doc/CHANGES. It's very important to keep this file up to date and conforming to the existing format, -because it will be used by scripts to automatically update pages on +because it will be used by scripts to automatically update pages on www.NetBSD.org and other sites. Additionally, check the pkgsrc/doc/TODO file and remove the entry for the package you updated, in case it was mentioned there. @@ -4238,15 +4240,15 @@ are various reasons for this: * A URL is volatile, and can change over time. It may go away completely or its information may be overwritten by newer information. - + * Having the change information between old and new versions in our CVS repository is very useful for people who use either cvs or anoncvs. - + * Having the change information between old and new versions in our CVS repository is very useful for people who read the pkgsrc-changes mailing list, so that they can make tactical decisions about when to upgrade the package. - + Please also recognise that, just because a new version of a package has been released, it should not automatically be upgraded in the CVS repository. We prefer to be conservative in the packages that are included in pkgsrc - @@ -4258,54 +4260,54 @@ possibly untested features. 14.4. Moving a package in pkgsrc 1. Make a copy of the directory somewhere else. - + 2. Remove all CVS dirs. - + Alternatively to the first two steps you can also do: - + % cvs -d user@cvs.NetBSD.org:/cvsroot export -D today pkgsrc/category/package - + and use that for further work. - + 3. Fix CATEGORIES and any DEPENDS paths that just did "../package" instead of "../../category/package". - + 4. cvs import the modified package in the new place. - + 5. Check if any package depends on it: - + % cd /usr/pkgsrc % grep /package */*/Makefile* */*/buildlink* - + 6. Fix paths in packages from step 5 to point to new location. - + 7. cvs rm (-f) the package at the old location. - + 8. Remove from oldcategory/Makefile. - + 9. Add to newcategory/Makefile. - + 10. Commit the changed and removed files: - + % cvs commit oldcategory/package oldcategory/Makefile newcategory/Makefile - + (and any packages from step 5, of course). - + Appendix A. A simple example package: bison Table of Contents A.1. files - + A.1.1. Makefile A.1.2. DESCR A.1.3. PLIST A.1.4. Checking a package with pkglint - + A.2. Steps for building, installing, packaging We checked to find a piece of software that wasn't in the packages collection, -and picked GNU bison. Quite why someone would want to have bison when Berkeley +and picked GNU bison. Quite why someone would want to have bison when Berkeley yacc is already present in the tree is beyond us, but it's useful for the purposes of this exercise. @@ -4428,7 +4430,7 @@ cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DH cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g closure.c cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g conflicts.c cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g derives.c -cc -c -DXPFILE=\"/usr/pkg/share/bison.simple\" -DXPFILE1=\"/usr/pkg/share/bison.hairy\" -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -g ./files.c +cc -c -DXPFILE=\"/usr/pkg/share/bison.simple\" -DXPFILE1=\"/usr/pkg/share/bison.hairy\" -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -g ./files.c cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g getargs.c cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g gram.c cc -c -DSTDC_HEADERS=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ALLOCA=1 -DHAVE_STRERROR=1 -I./../include -g lalr.c @@ -4499,8 +4501,8 @@ Connected to ftp.plig.net. 331 Guest login ok, send your complete e-mail address as password. 230-You are user #5 of 500 simultaneous users allowed. 230- -230- ___ _ _ _ -230- | _| |_ ___ ___| |_|___ ___ ___ ___ +230- ___ _ _ _ +230- | _| |_ ___ ___| |_|___ ___ ___ ___ 230- | _| _| . |_| . | | | . |_| . | _| . | 230- |_| |_| | _|_| _|_|_|_ |_|___|_| |_ | 230- |_| |_| |___| |___| @@ -4517,7 +4519,7 @@ Connected to ftp.plig.net. 230-RSYNC: rsync://ftp.plig.org/ (max 30 connections) 230- 230-Please email comments, bug reports and requests for packages to be -230-mirrored to ftp-admin@plig.org. +230-mirrored to ftp-admin@plig.org. 230- 230- 230 Logged in anonymously. @@ -4528,7 +4530,7 @@ Using binary mode to transfer files. 250-"/pub/figlet" is new cwd. 250- 250-Welcome to the figlet archive at ftp.figlet.org -250- +250- 250- ftp://ftp.figlet.org/pub/figlet/ 250- 250-The official FIGlet web page is: @@ -4536,7 +4538,7 @@ Using binary mode to transfer files. 250- 250-If you have questions, please mailto:info@figlet.org. If you want to 250-contribute a font or something else, you can email us. -250 +250 250 "/pub/figlet/program" is new cwd. 250 "/pub/figlet/program/unix" is new cwd. local: figlet221.tar.gz remote: figlet221.tar.gz @@ -4586,7 +4588,7 @@ B.2. Packaging figlet ===> Building binary package for figlet-2.2.1nb2 Creating package /home/cvs/pkgsrc/packages/i386/All/figlet-2.2.1nb2.tgz Using SrcDir value of /usr/pkg -Registering depends:. +Registering depends:. # Appendix C. Layout of the FTP server's package archive @@ -4650,23 +4652,23 @@ Layout for precompiled binary packages on ftp.NetBSD.org: SunOS-5.9/ sparc -> ../pkgsrc-2004Q1/SunOS-5.9/sparc x86 -> ../pkgsrc-2004Q1/SunOS-5.9/x86 - + To create: 1. Run bulk build, see Section 5.3, "Doing a bulk build of all packages" - + 2. Upload /usr/pkgsrc/packages to - + ftp://ftp.NetBSD.org/pub/NetBSD/packages/\ pkgsrc-2004Q3/\ # pkgsrc-branch `uname -s`-`uname -r`/ # OS & version `uname -p` # architecture - - + + 3. If necessary, create a symlink ln -s `uname -m` `uname -p` (amiga -> m68k, ...) - + Appendix D. Editing guidelines for the pkgsrc guide Table of Contents @@ -4682,20 +4684,20 @@ The pkgsrc guide's source code is stored in pkgsrc/doc/guide/files, and several files are created from it: * pkgsrc/doc/pkgsrc.txt, which replaces pkgsrc/Packages.txt - + * pkgsrc/doc/pkgsrc.html - + * http://www.NetBSD.org/Documentation/pkgsrc/: the documentation on the NetBSD website will be built from pkgsrc and kept up to date on the web server itself. This means you must make sure that your changes haven't broken the build! - + * http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.pdf: PDF version of the pkgsrc guide. - + * http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.ps: PostScript version of the pkgsrc guide. - + D.2. Procedure The procedure to edit the pkgsrc guide is: @@ -4706,24 +4708,24 @@ The procedure to edit the pkgsrc guide is: PostScript- and PDF version. You will need both packages installed, to make sure documentation is consistent across all formats. The packages can be found in pkgsrc/meta-pkgs/netbsd-doc and pkgsrc/meta-pkgs/netbsd-doc-print. - + * Edit the XML file(s) in pkgsrc/doc/guide/files. - + * Run make extract && make do-lint in pkgsrc/doc/guide to check the XML syntax, and fix it if needed. - + * Run make in pkgsrc/doc/guide to build the HTML and ASCII version. - + * If all is well, run make install-doc to put the generated files into pkgsrc /doc. - + * cvs commit pkgsrc/doc/guide/files - + * cvs commit -m re-generate pkgsrc/doc/pkgsrc.{html,txt} - + * Until the webserver on www.NetBSD.org is really updated automatically to pick up changes to the pkgsrc guide automatically, also run make install-htdoc HTDOCSDIR=../../../htdocs (or similar, adjust HTDOCSDIR!). - + * cvs commit htdocs/Documentation/pkgsrc - + |