Annotation of pkgsrc/doc/pkgsrc.html, revision 1.53

1.1       grant       1: <html xmlns="http://www.w3.org/1999/xhtml">
                      2: <head>
                      3:   <meta name="generator" content=
1.52      tv          4:   "HTML Tidy for NetBSD (vers 1 September 2005), see www.w3.org" />
1.1       grant       5:   <meta http-equiv="Content-Type" content=
                      6:   "text/html; charset=us-ascii" />
                      7: 
                      8:   <title>The pkgsrc guide</title>
                      9:   <link rel="stylesheet" href="/NetBSD.css" type="text/css" />
                     10:   <meta name="generator" content=
1.23      wiz        11:   "DocBook XSL Stylesheets VX.X.X" />
1.1       grant      12:   <meta name="description" content=
                     13:   "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." />
                     14:   </head>
                     15: 
                     16: <body bgcolor="white" text="black" link="#0000FF" vlink="#840084"
                     17: alink="#0000FF">
1.52      tv         18:   <div class="book" lang="en">
1.1       grant      19:     <div class="titlepage">
                     20:       <div>
                     21:         <div>
1.52      tv         22:           <h1 class="title"><a name="the-pkgsrc-guide"></a>The
                     23:           pkgsrc guide</h1>
1.1       grant      24:         </div>
                     25: 
                     26:         <div>
1.2       hubertf    27:           <h2 class="subtitle">Documentation on the NetBSD packages
1.1       grant      28:           system</h2>
                     29:         </div>
                     30: 
                     31:         <div>
                     32:           <div class="authorgroup">
                     33:             <div class="author">
                     34:               <h3 class="author"><span class=
                     35:               "firstname">Alistair</span> <span class=
                     36:               "surname">Crooks</span></h3>
                     37: 
                     38:               <div class="affiliation">
                     39:                 <div class="address">
1.14      xtraeme    40:                   <p><code class="email">&lt;<a href=
                     41:                   "mailto:agc@NetBSD.org">agc@NetBSD.org</a>&gt;</code></p>
1.1       grant      42:                 </div>
                     43:               </div>
                     44:             </div>
                     45: 
                     46:             <div class="author">
                     47:               <h3 class="author"><span class=
                     48:               "firstname">Hubert</span> <span class=
                     49:               "surname">Feyrer</span></h3>
                     50: 
                     51:               <div class="affiliation">
                     52:                 <div class="address">
1.14      xtraeme    53:                   <p><code class="email">&lt;<a href=
                     54:                   "mailto:hubertf@NetBSD.org">hubertf@NetBSD.org</a>&gt;</code></p>
1.1       grant      55:                 </div>
                     56:               </div>
                     57:             </div>
1.2       hubertf    58: 
1.3       hubertf    59:             <h3 class="corpauthor">The pkgsrc Developers</h3>
1.1       grant      60:           </div>
                     61:         </div>
                     62: 
                     63:         <div>
1.48      dillo      64:           <p class="copyright">Copyright &#169; 1994-2005 The
1.1       grant      65:           NetBSD Foundation, Inc</p>
                     66:         </div>
                     67: 
1.23      wiz        68:         <div xmlns="http://www.w3.org/TR/xhtml1/transitional">
1.48      dillo      69:           <p xmlns="" class="pubdate">$NetBSD: pkgsrc.xml,v 1.10
                     70:           2005/10/05 13:59:56 dillo Exp $</p>
1.1       grant      71:         </div>
                     72: 
                     73:         <div>
                     74:           <div class="abstract">
                     75:             <p class="title"><b>Abstract</b></p>
                     76: 
                     77:             <p>Information about using the NetBSD package system
                     78:             (pkgsrc) from both a user view for installing packages
                     79:             as well as from a pkgsrc developers' view for creating
                     80:             new packages.</p>
                     81:           </div>
                     82:         </div>
                     83:       </div>
                     84:       <hr />
                     85:     </div>
                     86: 
                     87:     <div class="toc">
                     88:       <p><b>Table of Contents</b></p>
                     89: 
                     90:       <dl>
1.51      rillig     91:         <dt><span class="chapter"><a href="#introduction">1. What
                     92:         is pkgsrc?</a></span></dt>
1.1       grant      93: 
                     94:         <dd>
                     95:           <dl>
1.30      wiz        96:             <dt><span class="sect1"><a href=
                     97:             "#introduction-section">1.1.
1.1       grant      98:             Introduction</a></span></dt>
                     99: 
                    100:             <dt><span class="sect1"><a href="#overview">1.2.
                    101:             Overview</a></span></dt>
                    102: 
                    103:             <dt><span class="sect1"><a href="#terminology">1.3.
                    104:             Terminology</a></span></dt>
                    105: 
                    106:             <dt><span class="sect1"><a href="#typography">1.4.
                    107:             Typography</a></span></dt>
                    108:           </dl>
                    109:         </dd>
                    110: 
1.46      gdt       111:         <dt><span class="part"><a href="#users-guide">I. The pkgsrc
1.1       grant     112:         user's guide</a></span></dt>
                    113: 
                    114:         <dd>
                    115:           <dl>
                    116:             <dt><span class="chapter"><a href="#getting">2. Where
                    117:             to get pkgsrc</a></span></dt>
                    118: 
                    119:             <dd>
                    120:               <dl>
1.30      wiz       121:                 <dt><span class="sect1"><a href="#as-tar-file">2.1.
1.1       grant     122:                 As tar file</a></span></dt>
                    123: 
1.30      wiz       124:                 <dt><span class="sect1"><a href="#via-sup">2.2. Via
                    125:                 SUP</a></span></dt>
1.1       grant     126: 
1.30      wiz       127:                 <dt><span class="sect1"><a href="#via-cvs">2.3. Via
                    128:                 CVS</a></span></dt>
1.1       grant     129:               </dl>
                    130:             </dd>
                    131: 
                    132:             <dt><span class="chapter"><a href="#platforms">3. Using
                    133:             pkgsrc on systems other than NetBSD</a></span></dt>
                    134: 
                    135:             <dd>
                    136:               <dl>
1.30      wiz       137:                 <dt><span class="sect1"><a href=
                    138:                 "#bootstrapping-pkgsrc">3.1. Bootstrapping
                    139:                 pkgsrc</a></span></dt>
1.1       grant     140: 
1.30      wiz       141:                 <dt><span class="sect1"><a href=
1.47      reed      142:                 "#platform-specific-notes">3.2. Platform-specific
1.30      wiz       143:                 notes</a></span></dt>
1.1       grant     144: 
                    145:                 <dd>
                    146:                   <dl>
                    147:                     <dt><span class="sect2"><a href=
1.30      wiz       148:                     "#darwin">3.2.1. Darwin (Mac OS
1.1       grant     149:                     X)</a></span></dt>
                    150: 
                    151:                     <dt><span class="sect2"><a href=
1.30      wiz       152:                     "#freebsd">3.2.2. FreeBSD</a></span></dt>
1.1       grant     153: 
                    154:                     <dt><span class="sect2"><a href=
1.30      wiz       155:                     "#interix">3.2.3. Interix</a></span></dt>
1.1       grant     156: 
1.30      wiz       157:                     <dt><span class="sect2"><a href="#irix">3.2.4.
                    158:                     IRIX</a></span></dt>
1.1       grant     159: 
1.30      wiz       160:                     <dt><span class="sect2"><a href="#linux">3.2.5.
                    161:                     Linux</a></span></dt>
1.1       grant     162: 
                    163:                     <dt><span class="sect2"><a href=
1.30      wiz       164:                     "#openbsd">3.2.6. OpenBSD</a></span></dt>
1.22      tv        165: 
                    166:                     <dt><span class="sect2"><a href=
1.30      wiz       167:                     "#solaris">3.2.7. Solaris</a></span></dt>
1.1       grant     168:                   </dl>
                    169:                 </dd>
                    170:               </dl>
                    171:             </dd>
                    172: 
                    173:             <dt><span class="chapter"><a href="#using">4. Using
                    174:             pkgsrc</a></span></dt>
                    175: 
                    176:             <dd>
                    177:               <dl>
                    178:                 <dt><span class="sect1"><a href=
                    179:                 "#getting-started">4.1. Working with binary
                    180:                 packages</a></span></dt>
                    181: 
                    182:                 <dd>
                    183:                   <dl>
                    184:                     <dt><span class="sect2"><a href=
1.30      wiz       185:                     "#where-to-get-binary-packages">4.1.1. Where to
                    186:                     get binary packages</a></span></dt>
1.1       grant     187: 
                    188:                     <dt><span class="sect2"><a href=
1.30      wiz       189:                     "#how-to-use-binary-packages">4.1.2. How to use
                    190:                     binary packages</a></span></dt>
1.1       grant     191: 
                    192:                     <dt><span class="sect2"><a href=
1.30      wiz       193:                     "#a-word-of-warning">4.1.3. A word of
1.1       grant     194:                     warning</a></span></dt>
                    195:                   </dl>
                    196:                 </dd>
                    197: 
1.30      wiz       198:                 <dt><span class="sect1"><a href=
                    199:                 "#building-packages-from-source">4.2. Building
                    200:                 packages from source</a></span></dt>
1.1       grant     201: 
                    202:                 <dd>
                    203:                   <dl>
                    204:                     <dt><span class="sect2"><a href=
1.30      wiz       205:                     "#requirements">4.2.1.
1.1       grant     206:                     Requirements</a></span></dt>
                    207: 
                    208:                     <dt><span class="sect2"><a href=
1.30      wiz       209:                     "#fetching-distfiles">4.2.2. Fetching
1.1       grant     210:                     distfiles</a></span></dt>
                    211: 
                    212:                     <dt><span class="sect2"><a href=
1.30      wiz       213:                     "#how-to-build-and-install">4.2.3. How to build
                    214:                     and install</a></span></dt>
1.1       grant     215: 
                    216:                     <dt><span class="sect2"><a href=
1.30      wiz       217:                     "#selecting-the-compiler">4.2.4. Selecting the
1.1       grant     218:                     compiler</a></span></dt>
                    219:                   </dl>
                    220:                 </dd>
                    221:               </dl>
                    222:             </dd>
                    223: 
1.38      dillo     224:             <dt><span class="chapter"><a href="#configuring">5.
                    225:             Configuring pkgsrc</a></span></dt>
                    226: 
                    227:             <dd>
                    228:               <dl>
                    229:                 <dt><span class="sect1"><a href=
1.45      wiz       230:                 "#general-configuration">5.1. General
                    231:                 configuration</a></span></dt>
                    232: 
                    233:                 <dt><span class="sect1"><a href=
                    234:                 "#variables-affecting-build">5.2. Variables
                    235:                 affecting the build process</a></span></dt>
                    236: 
                    237:                 <dt><span class="sect1"><a href=
                    238:                 "#developer-advanced-settings">5.3.
                    239:                 Developer/advanced settings</a></span></dt>
                    240: 
                    241:                 <dt><span class="sect1"><a href=
                    242:                 "#selecting-build-options">5.4. Selecting Build
1.42      dillo     243:                 Options</a></span></dt>
1.38      dillo     244:               </dl>
                    245:             </dd>
                    246: 
                    247:             <dt><span class="chapter"><a href="#binary">6. Creating
1.1       grant     248:             binary packages</a></span></dt>
                    249: 
                    250:             <dd>
                    251:               <dl>
1.30      wiz       252:                 <dt><span class="sect1"><a href=
1.38      dillo     253:                 "#building-a-single-binary-package">6.1. Building a
1.30      wiz       254:                 single binary package</a></span></dt>
1.1       grant     255: 
1.30      wiz       256:                 <dt><span class="sect1"><a href=
1.38      dillo     257:                 "#settings-for-creationg-of-binary-packages">6.2.
1.1       grant     258:                 Settings for creation of binary
                    259:                 packages</a></span></dt>
                    260: 
1.38      dillo     261:                 <dt><span class="sect1"><a href="#bulkbuild">6.3.
1.1       grant     262:                 Doing a bulk build of all packages</a></span></dt>
                    263: 
                    264:                 <dd>
                    265:                   <dl>
                    266:                     <dt><span class="sect2"><a href=
1.38      dillo     267:                     "#binary.configuration">6.3.1.
1.1       grant     268:                     Configuration</a></span></dt>
                    269: 
                    270:                     <dt><span class="sect2"><a href=
1.38      dillo     271:                     "#other-environmental-considerations">6.3.2.
1.30      wiz       272:                     Other environmental
1.1       grant     273:                     considerations</a></span></dt>
                    274: 
                    275:                     <dt><span class="sect2"><a href=
1.38      dillo     276:                     "#operation">6.3.3. Operation</a></span></dt>
1.1       grant     277: 
                    278:                     <dt><span class="sect2"><a href=
1.38      dillo     279:                     "#what-it-does">6.3.4. What it
1.1       grant     280:                     does</a></span></dt>
                    281: 
                    282:                     <dt><span class="sect2"><a href=
1.38      dillo     283:                     "#disk-space-requirements">6.3.5. Disk space
1.1       grant     284:                     requirements</a></span></dt>
                    285: 
                    286:                     <dt><span class="sect2"><a href=
1.38      dillo     287:                     "#setting-up-a-sandbox">6.3.6. Setting up a
1.47      reed      288:                     sandbox for chrooted builds</a></span></dt>
1.1       grant     289: 
                    290:                     <dt><span class="sect2"><a href=
1.38      dillo     291:                     "#building-a-partial-set">6.3.7. Building a
1.30      wiz       292:                     partial set of packages</a></span></dt>
1.13      hubertf   293: 
                    294:                     <dt><span class="sect2"><a href=
1.38      dillo     295:                     "#bulk-upload">6.3.8. Uploading results of a
1.13      hubertf   296:                     bulk build</a></span></dt>
1.1       grant     297:                   </dl>
                    298:                 </dd>
                    299: 
1.30      wiz       300:                 <dt><span class="sect1"><a href=
1.38      dillo     301:                 "#creating-cdroms">6.4. Creating a multiple CD-ROM
1.30      wiz       302:                 packages collection</a></span></dt>
1.1       grant     303: 
                    304:                 <dd>
                    305:                   <dl>
                    306:                     <dt><span class="sect2"><a href=
1.38      dillo     307:                     "#cdpack-example">6.4.1. Example of
1.1       grant     308:                     cdpack</a></span></dt>
                    309:                   </dl>
                    310:                 </dd>
                    311:               </dl>
                    312:             </dd>
                    313: 
1.38      dillo     314:             <dt><span class="chapter"><a href="#faq">7. Frequently
1.1       grant     315:             Asked Questions</a></span></dt>
                    316: 
                    317:             <dd>
                    318:               <dl>
1.30      wiz       319:                 <dt><span class="sect1"><a href=
1.38      dillo     320:                 "#mailing-list-pointers">7.1. Are there any mailing
1.30      wiz       321:                 lists for pkg-related discussion?</a></span></dt>
1.1       grant     322: 
1.30      wiz       323:                 <dt><span class="sect1"><a href=
1.38      dillo     324:                 "#pkgviews-docs">7.2. Where's the pkgviews
1.30      wiz       325:                 documentation?</a></span></dt>
1.1       grant     326: 
1.5       hubertf   327:                 <dt><span class="sect1"><a href=
1.38      dillo     328:                 "#faq-pkgtools">7.3. Utilities for package
1.5       hubertf   329:                 management (pkgtools)</a></span></dt>
1.1       grant     330: 
1.30      wiz       331:                 <dt><span class="sect1"><a href=
1.38      dillo     332:                 "#non-root-pkgsrc">7.4. How to use pkgsrc as
1.30      wiz       333:                 non-root</a></span></dt>
                    334: 
                    335:                 <dt><span class="sect1"><a href=
1.38      dillo     336:                 "#resume-transfers">7.5. How to resume transfers
1.30      wiz       337:                 when fetching distfiles?</a></span></dt>
                    338: 
                    339:                 <dt><span class="sect1"><a href=
1.38      dillo     340:                 "#XFree86-from-pkgsrc">7.6. How can I install/use
1.30      wiz       341:                 XFree86 from pkgsrc?</a></span></dt>
                    342: 
                    343:                 <dt><span class="sect1"><a href=
1.38      dillo     344:                 "#x.org-from-pkgsrc">7.7. How can I install/use
1.30      wiz       345:                 X.org from pkgsrc?</a></span></dt>
1.1       grant     346: 
1.30      wiz       347:                 <dt><span class="sect1"><a href=
1.38      dillo     348:                 "#fetch-behind-firewall">7.8. How to fetch files
1.30      wiz       349:                 from behind a firewall</a></span></dt>
1.1       grant     350: 
1.38      dillo     351:                 <dt><span class="sect1"><a href="#passive-ftp">7.9.
1.14      xtraeme   352:                 How do I tell <span><strong class="command">make
                    353:                 fetch</strong></span> to do passive
1.1       grant     354:                 FTP?</a></span></dt>
                    355: 
1.30      wiz       356:                 <dt><span class="sect1"><a href=
1.38      dillo     357:                 "#fetching-all-distfiles">7.10. How to fetch all
1.30      wiz       358:                 distfiles at once</a></span></dt>
1.1       grant     359: 
1.30      wiz       360:                 <dt><span class="sect1"><a href=
1.38      dillo     361:                 "#tmac.andoc-missing">7.11. What does
1.30      wiz       362:                 &#8220;<span class="quote">Don't know how to make
                    363:                 /usr/share/tmac/tmac.andoc</span>&#8221;
1.14      xtraeme   364:                 mean?</a></span></dt>
1.13      hubertf   365: 
1.30      wiz       366:                 <dt><span class="sect1"><a href=
1.38      dillo     367:                 "#bsd.own.mk-missing">7.12. What does
1.30      wiz       368:                 &#8220;<span class="quote">Could not find
1.14      xtraeme   369:                 bsd.own.mk</span>&#8221; mean?</a></span></dt>
1.1       grant     370: 
1.30      wiz       371:                 <dt><span class="sect1"><a href=
1.38      dillo     372:                 "#using-sudo-with-pkgsrc">7.13. Using 'sudo' with
1.30      wiz       373:                 pkgsrc</a></span></dt>
1.1       grant     374: 
1.38      dillo     375:                 <dt><span class="sect1"><a href="#faq.conf">7.14.
1.35      jmmv      376:                 How do I change the location of configuration
                    377:                 files?</a></span></dt>
1.1       grant     378: 
                    379:                 <dt><span class="sect1"><a href=
1.38      dillo     380:                 "#audit-packages">7.15. Automated security
1.1       grant     381:                 checks</a></span></dt>
                    382:               </dl>
                    383:             </dd>
                    384:           </dl>
                    385:         </dd>
                    386: 
1.46      gdt       387:         <dt><span class="part"><a href="#developers-guide">II. The
1.1       grant     388:         pkgsrc developer's guide</a></span></dt>
                    389: 
                    390:         <dd>
                    391:           <dl>
1.38      dillo     392:             <dt><span class="chapter"><a href="#components">8.
1.27      rillig    393:             Package components - files, directories and
                    394:             contents</a></span></dt>
                    395: 
                    396:             <dd>
                    397:               <dl>
                    398:                 <dt><span class="sect1"><a href=
1.45      wiz       399:                 "#components.Makefile">8.1. <code xmlns=
                    400:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig    401:                 "filename">Makefile</code></a></span></dt>
                    402: 
                    403:                 <dt><span class="sect1"><a href=
1.45      wiz       404:                 "#components.distinfo">8.2. <code xmlns=
                    405:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig    406:                 "filename">distinfo</code></a></span></dt>
                    407: 
                    408:                 <dt><span class="sect1"><a href=
1.38      dillo     409:                 "#components.patches">8.3.
1.27      rillig    410:                 patches/*</a></span></dt>
                    411: 
1.30      wiz       412:                 <dt><span class="sect1"><a href=
1.38      dillo     413:                 "#other-mandatory-files">8.4. Other mandatory
1.30      wiz       414:                 files</a></span></dt>
1.27      rillig    415: 
                    416:                 <dt><span class="sect1"><a href=
1.38      dillo     417:                 "#components.optional">8.5. Optional
1.27      rillig    418:                 files</a></span></dt>
                    419: 
1.38      dillo     420:                 <dt><span class="sect1"><a href="#work-dir">8.6.
1.45      wiz       421:                 <code xmlns=
                    422:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                    423:                 "filename">work*</code></a></span></dt>
1.27      rillig    424: 
1.38      dillo     425:                 <dt><span class="sect1"><a href="#files-dir">8.7.
1.45      wiz       426:                 <code xmlns=
                    427:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig    428:                 "filename">files/*</code></a></span></dt>
                    429:               </dl>
                    430:             </dd>
                    431: 
1.38      dillo     432:             <dt><span class="chapter"><a href="#makefile">9.
1.45      wiz       433:             Programming in <code xmlns=
                    434:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.25      rillig    435:             "filename">Makefile</code>s</a></span></dt>
                    436: 
                    437:             <dd>
                    438:               <dl>
                    439:                 <dt><span class="sect1"><a href=
1.45      wiz       440:                 "#makefile.variables">9.1. <code xmlns=
                    441:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.25      rillig    442:                 "filename">Makefile</code>
                    443:                 variables</a></span></dt>
                    444: 
1.27      rillig    445:                 <dd>
                    446:                   <dl>
                    447:                     <dt><span class="sect2"><a href=
1.38      dillo     448:                     "#makefile.variables.names">9.1.1. Naming
1.27      rillig    449:                     conventions</a></span></dt>
                    450:                   </dl>
                    451:                 </dd>
                    452: 
1.25      rillig    453:                 <dt><span class="sect1"><a href=
1.38      dillo     454:                 "#makefile.code">9.2. Code snippets</a></span></dt>
1.25      rillig    455: 
                    456:                 <dd>
                    457:                   <dl>
                    458:                     <dt><span class="sect2"><a href=
1.38      dillo     459:                     "#adding-to-list">9.2.1. Adding things to a
1.25      rillig    460:                     list</a></span></dt>
                    461: 
                    462:                     <dt><span class="sect2"><a href=
1.38      dillo     463:                     "#converting-internal-to-external">9.2.2.
1.30      wiz       464:                     Converting an internal list into an external
                    465:                     list</a></span></dt>
1.25      rillig    466: 
                    467:                     <dt><span class="sect2"><a href=
1.38      dillo     468:                     "#passing-variable-to-shell">9.2.3. Passing
1.30      wiz       469:                     variables to a shell command</a></span></dt>
1.27      rillig    470: 
                    471:                     <dt><span class="sect2"><a href=
1.38      dillo     472:                     "#quoting-guideline">9.2.4. Quoting
1.27      rillig    473:                     guideline</a></span></dt>
                    474: 
                    475:                     <dt><span class="sect2"><a href=
1.38      dillo     476:                     "#bsd-make-bug-workaround">9.2.5. Workaround
1.30      wiz       477:                     for a bug in BSD Make</a></span></dt>
1.25      rillig    478:                   </dl>
                    479:                 </dd>
                    480:               </dl>
                    481:             </dd>
                    482: 
1.38      dillo     483:             <dt><span class="chapter"><a href="#plist">10. PLIST
1.1       grant     484:             issues</a></span></dt>
                    485: 
                    486:             <dd>
                    487:               <dl>
1.38      dillo     488:                 <dt><span class="sect1"><a href="#rcs-id">10.1. RCS
1.30      wiz       489:                 ID</a></span></dt>
1.1       grant     490: 
1.30      wiz       491:                 <dt><span class="sect1"><a href=
1.38      dillo     492:                 "#automatic-plist-generation">10.2. Semi-automatic
1.45      wiz       493:                 <code xmlns=
                    494:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                    495:                 "filename">PLIST</code> generation</a></span></dt>
1.1       grant     496: 
1.38      dillo     497:                 <dt><span class="sect1"><a href=
                    498:                 "#print-PLIST">10.3. Tweaking output of
                    499:                 <span><strong class="command">make
1.14      xtraeme   500:                 print-PLIST</strong></span></a></span></dt>
1.1       grant     501: 
1.38      dillo     502:                 <dt><span class="sect1"><a href="#plist.misc">10.4.
1.1       grant     503:                 Variable substitution in PLIST</a></span></dt>
                    504: 
1.30      wiz       505:                 <dt><span class="sect1"><a href=
1.48      dillo     506:                 "#manpage-compression">10.5. Man page
                    507:                 compression</a></span></dt>
1.1       grant     508: 
1.30      wiz       509:                 <dt><span class="sect1"><a href=
1.38      dillo     510:                 "#using-PLIST_SRC">10.6. Changing PLIST source with
1.30      wiz       511:                 <code class=
1.14      xtraeme   512:                 "varname">PLIST_SRC</code></a></span></dt>
1.1       grant     513: 
1.30      wiz       514:                 <dt><span class="sect1"><a href=
1.47      reed      515:                 "#platform-specific-plist">10.7. Platform-specific
1.30      wiz       516:                 and differing PLISTs</a></span></dt>
1.1       grant     517: 
                    518:                 <dt><span class="sect1"><a href=
1.38      dillo     519:                 "#faq.common-dirs">10.8. Sharing directories
                    520:                 between packages</a></span></dt>
1.1       grant     521:               </dl>
                    522:             </dd>
                    523: 
1.38      dillo     524:             <dt><span class="chapter"><a href="#buildlink">11.
1.1       grant     525:             Buildlink methodology</a></span></dt>
                    526: 
                    527:             <dd>
                    528:               <dl>
1.30      wiz       529:                 <dt><span class="sect1"><a href=
1.38      dillo     530:                 "#converting-to-buildlink3">11.1. Converting
1.30      wiz       531:                 packages to use buildlink3</a></span></dt>
1.1       grant     532: 
1.30      wiz       533:                 <dt><span class="sect1"><a href=
1.38      dillo     534:                 "#creating-buildlink3.mk">11.2. Writing
1.45      wiz       535:                 <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                    536:                 class="filename">buildlink3.mk</code>
1.14      xtraeme   537:                 files</a></span></dt>
1.1       grant     538: 
                    539:                 <dd>
                    540:                   <dl>
                    541:                     <dt><span class="sect2"><a href=
1.38      dillo     542:                     "#anatomy-of-bl3">11.2.1. Anatomy of a
1.30      wiz       543:                     buildlink3.mk file</a></span></dt>
1.1       grant     544: 
                    545:                     <dt><span class="sect2"><a href=
1.38      dillo     546:                     "#updating-buildlink-depends">11.2.2. Updating
1.30      wiz       547:                     <code class=
1.14      xtraeme   548:                     "varname">BUILDLINK_DEPENDS.<em class=
                    549:                     "replaceable"><code>pkg</code></em></code> in
1.45      wiz       550:                     <code xmlns=
                    551:                     "http://www.w3.org/TR/xhtml1/transitional"
                    552:                     class="filename">buildlink3.mk</code>
1.1       grant     553:                     files</a></span></dt>
                    554:                   </dl>
                    555:                 </dd>
                    556: 
1.30      wiz       557:                 <dt><span class="sect1"><a href=
1.45      wiz       558:                 "#writing-builtin.mk">11.3. Writing <code xmlns=
                    559:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.30      wiz       560:                 "filename">builtin.mk</code> files</a></span></dt>
1.1       grant     561: 
                    562:                 <dd>
                    563:                   <dl>
                    564:                     <dt><span class="sect2"><a href=
1.38      dillo     565:                     "#anatomy-of-builtin.mk">11.3.1. Anatomy of a
1.45      wiz       566:                     <code xmlns=
                    567:                     "http://www.w3.org/TR/xhtml1/transitional"
                    568:                     class="filename">builtin.mk</code>
1.1       grant     569:                     file</a></span></dt>
                    570: 
                    571:                     <dt><span class="sect2"><a href=
1.38      dillo     572:                     "#native-or-pkgsrc-preference">11.3.2. Global
1.30      wiz       573:                     preferences for native or pkgsrc
                    574:                     software</a></span></dt>
1.1       grant     575:                   </dl>
                    576:                 </dd>
                    577:               </dl>
                    578:             </dd>
                    579: 
1.38      dillo     580:             <dt><span class="chapter"><a href="#pkginstall">12. The
1.35      jmmv      581:             pkginstall framework</a></span></dt>
                    582: 
                    583:             <dd>
                    584:               <dl>
                    585:                 <dt><span class="sect1"><a href=
1.38      dillo     586:                 "#files-and-dirs-outside-prefix">12.1. Files and
1.35      jmmv      587:                 directories outside the installation
                    588:                 prefix</a></span></dt>
                    589: 
                    590:                 <dd>
                    591:                   <dl>
                    592:                     <dt><span class="sect2"><a href=
1.38      dillo     593:                     "#dirs-outside-prefix">12.1.1. Directory
1.35      jmmv      594:                     manipulation</a></span></dt>
                    595: 
                    596:                     <dt><span class="sect2"><a href=
1.38      dillo     597:                     "#files-outside-prefix">12.1.2. File
1.35      jmmv      598:                     manipulation</a></span></dt>
                    599:                   </dl>
                    600:                 </dd>
                    601: 
1.38      dillo     602:                 <dt><span class="sect1"><a href="#conf-files">12.2.
1.35      jmmv      603:                 Configuration files</a></span></dt>
                    604: 
                    605:                 <dd>
                    606:                   <dl>
                    607:                     <dt><span class="sect2"><a href=
1.38      dillo     608:                     "#conf-files-sysconfdir">12.2.1. How
1.35      jmmv      609:                     <code class="varname">PKG_SYSCONFDIR</code> is
                    610:                     set</a></span></dt>
                    611: 
                    612:                     <dt><span class="sect2"><a href=
1.38      dillo     613:                     "#conf-files-configure">12.2.2. Telling the
1.47      reed      614:                     software where configuration files
1.35      jmmv      615:                     are</a></span></dt>
                    616: 
                    617:                     <dt><span class="sect2"><a href=
1.38      dillo     618:                     "#conf-files-patching">12.2.3. Patching
1.35      jmmv      619:                     installations</a></span></dt>
                    620: 
                    621:                     <dt><span class="sect2"><a href=
1.38      dillo     622:                     "#conf-files-disable">12.2.4. Disabling
1.35      jmmv      623:                     handling of configuration files</a></span></dt>
                    624:                   </dl>
                    625:                 </dd>
                    626: 
                    627:                 <dt><span class="sect1"><a href=
1.38      dillo     628:                 "#rcd-scripts">12.3. System startup
1.35      jmmv      629:                 scripts</a></span></dt>
                    630: 
                    631:                 <dd>
                    632:                   <dl>
                    633:                     <dt><span class="sect2"><a href=
1.38      dillo     634:                     "#rcd-scripts-disable">12.3.1. Disabling
1.35      jmmv      635:                     handling of system startup
                    636:                     scripts</a></span></dt>
                    637:                   </dl>
                    638:                 </dd>
                    639: 
                    640:                 <dt><span class="sect1"><a href=
1.38      dillo     641:                 "#users-and-groups">12.4. System users and
1.35      jmmv      642:                 groups</a></span></dt>
                    643: 
1.38      dillo     644:                 <dt><span class="sect1"><a href="#shells">12.5.
1.35      jmmv      645:                 System shells</a></span></dt>
                    646: 
                    647:                 <dd>
                    648:                   <dl>
                    649:                     <dt><span class="sect2"><a href=
1.38      dillo     650:                     "#shells-disable">12.5.1. Disabling handling of
1.35      jmmv      651:                     configuration files</a></span></dt>
                    652:                   </dl>
                    653:                 </dd>
                    654:               </dl>
                    655:             </dd>
                    656: 
1.38      dillo     657:             <dt><span class="chapter"><a href="#options">13.
1.1       grant     658:             Options handling</a></span></dt>
                    659: 
                    660:             <dd>
                    661:               <dl>
1.30      wiz       662:                 <dt><span class="sect1"><a href=
1.38      dillo     663:                 "#global-default-options">13.1. Global default
1.30      wiz       664:                 options</a></span></dt>
1.1       grant     665: 
1.30      wiz       666:                 <dt><span class="sect1"><a href=
1.38      dillo     667:                 "#converting-to-options">13.2. Converting packages
1.45      wiz       668:                 to use <code xmlns=
                    669:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme   670:                 "filename">bsd.options.mk</code></a></span></dt>
1.48      dillo     671: 
                    672:                 <dt><span class="sect1"><a href=
                    673:                 "#option-names">13.3. Option Names</a></span></dt>
1.1       grant     674:               </dl>
                    675:             </dd>
                    676: 
1.38      dillo     677:             <dt><span class="chapter"><a href="#build">14. The
1.1       grant     678:             build process</a></span></dt>
                    679: 
                    680:             <dd>
                    681:               <dl>
                    682:                 <dt><span class="sect1"><a href=
1.38      dillo     683:                 "#build.prefix">14.1. Program
1.1       grant     684:                 location</a></span></dt>
                    685: 
1.30      wiz       686:                 <dt><span class="sect1"><a href=
1.38      dillo     687:                 "#main-targets">14.2. Main targets</a></span></dt>
1.1       grant     688: 
                    689:                 <dt><span class="sect1"><a href=
1.38      dillo     690:                 "#build.helpful-targets">14.3. Other helpful
1.1       grant     691:                 targets</a></span></dt>
                    692:               </dl>
                    693:             </dd>
                    694: 
1.38      dillo     695:             <dt><span class="chapter"><a href="#fixes">15. Notes on
1.1       grant     696:             fixes for packages</a></span></dt>
                    697: 
                    698:             <dd>
                    699:               <dl>
1.30      wiz       700:                 <dt><span class="sect1"><a href=
1.38      dillo     701:                 "#general-operation">15.1. General
1.30      wiz       702:                 operation</a></span></dt>
1.1       grant     703: 
                    704:                 <dd>
                    705:                   <dl>
                    706:                     <dt><span class="sect2"><a href=
1.38      dillo     707:                     "#pulling-vars-from-etc-mk.conf">15.1.1. How to
1.30      wiz       708:                     pull in variables from
                    709:                     /etc/mk.conf</a></span></dt>
1.1       grant     710: 
                    711:                     <dt><span class="sect2"><a href=
1.38      dillo     712:                     "#where-to-install-documentation">15.1.2. Where
1.31      wiz       713:                     to install documentation</a></span></dt>
                    714: 
                    715:                     <dt><span class="sect2"><a href=
1.38      dillo     716:                     "#restricted-packages">15.1.3. Restricted
1.1       grant     717:                     packages</a></span></dt>
                    718: 
                    719:                     <dt><span class="sect2"><a href=
1.38      dillo     720:                     "#dependencies">15.1.4. Handling
1.1       grant     721:                     dependencies</a></span></dt>
                    722: 
                    723:                     <dt><span class="sect2"><a href=
1.38      dillo     724:                     "#conflicts">15.1.5. Handling conflicts with
1.1       grant     725:                     other packages</a></span></dt>
                    726: 
                    727:                     <dt><span class="sect2"><a href=
1.38      dillo     728:                     "#not-building-packages">15.1.6. Packages that
1.30      wiz       729:                     cannot or should not be built</a></span></dt>
1.1       grant     730: 
                    731:                     <dt><span class="sect2"><a href=
1.38      dillo     732:                     "#undeletable-packages">15.1.7. Packages which
1.30      wiz       733:                     should not be deleted, once
                    734:                     installed</a></span></dt>
1.1       grant     735: 
                    736:                     <dt><span class="sect2"><a href=
1.38      dillo     737:                     "#security-handling">15.1.8. Handling packages
1.1       grant     738:                     with security problems</a></span></dt>
                    739: 
                    740:                     <dt><span class="sect2"><a href=
1.38      dillo     741:                     "#compiler-bugs">15.1.9. How to handle compiler
1.1       grant     742:                     bugs</a></span></dt>
                    743: 
                    744:                     <dt><span class="sect2"><a href=
1.38      dillo     745:                     "#bumping-pkgrevision">15.1.10. How to handle
1.30      wiz       746:                     incrementing versions when fixing an existing
1.1       grant     747:                     package</a></span></dt>
                    748: 
                    749:                     <dt><span class="sect2"><a href=
1.38      dillo     750:                     "#portability-of-packages">15.1.11. Portability
1.30      wiz       751:                     of packages</a></span></dt>
1.1       grant     752:                   </dl>
                    753:                 </dd>
                    754: 
1.30      wiz       755:                 <dt><span class="sect1"><a href=
1.38      dillo     756:                 "#downloading-issues">15.2. Possible downloading
1.30      wiz       757:                 issues</a></span></dt>
1.1       grant     758: 
                    759:                 <dd>
                    760:                   <dl>
                    761:                     <dt><span class="sect2"><a href=
1.38      dillo     762:                     "#no-plain-download">15.2.1. Packages whose
1.30      wiz       763:                     distfiles aren't available for plain
1.1       grant     764:                     downloading</a></span></dt>
                    765: 
                    766:                     <dt><span class="sect2"><a href=
1.38      dillo     767:                     "#modified-distfiles-same-name">15.2.2. How to
1.30      wiz       768:                     handle modified distfiles with the 'old'
                    769:                     name</a></span></dt>
1.1       grant     770:                   </dl>
                    771:                 </dd>
                    772: 
1.30      wiz       773:                 <dt><span class="sect1"><a href=
1.38      dillo     774:                 "#configuration-gotchas">15.3. Configuration
1.30      wiz       775:                 gotchas</a></span></dt>
1.1       grant     776: 
                    777:                 <dd>
                    778:                   <dl>
                    779:                     <dt><span class="sect2"><a href=
1.38      dillo     780:                     "#fixes.libtool">15.3.1. Shared libraries -
1.1       grant     781:                     libtool</a></span></dt>
                    782: 
                    783:                     <dt><span class="sect2"><a href=
1.38      dillo     784:                     "#using-libtool">15.3.2. Using libtool on GNU
1.1       grant     785:                     packages that already support
                    786:                     libtool</a></span></dt>
                    787: 
                    788:                     <dt><span class="sect2"><a href=
1.38      dillo     789:                     "#autoconf-automake">15.3.3. GNU
1.1       grant     790:                     Autoconf/Automake</a></span></dt>
                    791:                   </dl>
                    792:                 </dd>
                    793: 
1.30      wiz       794:                 <dt><span class="sect1"><a href=
1.38      dillo     795:                 "#building-considerations">15.4. Building
1.30      wiz       796:                 considerations</a></span></dt>
1.1       grant     797: 
                    798:                 <dd>
                    799:                   <dl>
                    800:                     <dt><span class="sect2"><a href=
1.38      dillo     801:                     "#cpp-defines">15.4.1. CPP
1.1       grant     802:                     defines</a></span></dt>
1.51      rillig    803: 
                    804:                     <dt><span class="sect2"><a href=
                    805:                     "#cpp-list">15.4.2. Getting a list of CPP
                    806:                     defines</a></span></dt>
1.1       grant     807:                   </dl>
                    808:                 </dd>
                    809: 
1.30      wiz       810:                 <dt><span class="sect1"><a href=
1.38      dillo     811:                 "#package-specific-actions">15.5. Package specific
1.30      wiz       812:                 actions</a></span></dt>
1.1       grant     813: 
                    814:                 <dd>
                    815:                   <dl>
                    816:                     <dt><span class="sect2"><a href=
1.38      dillo     817:                     "#user-interaction">15.5.1. User
1.2       hubertf   818:                     interaction</a></span></dt>
1.1       grant     819: 
                    820:                     <dt><span class="sect2"><a href=
1.38      dillo     821:                     "#handling-licenses">15.5.2. Handling
1.1       grant     822:                     licenses</a></span></dt>
                    823: 
                    824:                     <dt><span class="sect2"><a href=
1.38      dillo     825:                     "#installing-score-files">15.5.3. Installing
1.30      wiz       826:                     score files</a></span></dt>
1.1       grant     827: 
                    828:                     <dt><span class="sect2"><a href=
1.38      dillo     829:                     "#perl-scripts">15.5.4. Packages containing
1.30      wiz       830:                     perl scripts</a></span></dt>
1.1       grant     831: 
                    832:                     <dt><span class="sect2"><a href=
1.38      dillo     833:                     "#hardcoded-paths">15.5.5. Packages with
1.30      wiz       834:                     hardcoded paths to other
                    835:                     interpreters</a></span></dt>
1.1       grant     836: 
                    837:                     <dt><span class="sect2"><a href=
1.38      dillo     838:                     "#perl-modules">15.5.6. Packages installing
1.30      wiz       839:                     perl modules</a></span></dt>
1.1       grant     840: 
                    841:                     <dt><span class="sect2"><a href=
1.38      dillo     842:                     "#faq.info-files">15.5.7. Packages installing
1.1       grant     843:                     info files</a></span></dt>
                    844: 
                    845:                     <dt><span class="sect2"><a href=
1.38      dillo     846:                     "#gconf2-data-files">15.5.8. Packages
1.30      wiz       847:                     installing GConf2 data files</a></span></dt>
1.1       grant     848: 
                    849:                     <dt><span class="sect2"><a href=
1.38      dillo     850:                     "#scrollkeeper-data-files">15.5.9. Packages
1.30      wiz       851:                     installing scrollkeeper data
                    852:                     files</a></span></dt>
1.1       grant     853: 
                    854:                     <dt><span class="sect2"><a href=
1.38      dillo     855:                     "#x11-fonts">15.5.10. Packages installing X11
1.1       grant     856:                     fonts</a></span></dt>
                    857: 
                    858:                     <dt><span class="sect2"><a href=
1.38      dillo     859:                     "#gtk2-modules">15.5.11. Packages installing
1.30      wiz       860:                     GTK2 modules</a></span></dt>
1.1       grant     861: 
                    862:                     <dt><span class="sect2"><a href=
1.38      dillo     863:                     "#sgml-xml-data">15.5.12. Packages installing
1.30      wiz       864:                     SGML or XML data</a></span></dt>
1.1       grant     865: 
                    866:                     <dt><span class="sect2"><a href=
1.38      dillo     867:                     "#mime-database">15.5.13. Packages installing
1.1       grant     868:                     extensions to the MIME database</a></span></dt>
                    869: 
                    870:                     <dt><span class="sect2"><a href=
1.38      dillo     871:                     "#intltool">15.5.14. Packages using
1.1       grant     872:                     intltool</a></span></dt>
1.18      xtraeme   873: 
                    874:                     <dt><span class="sect2"><a href=
1.38      dillo     875:                     "#startup-scripts">15.5.15. Packages installing
1.18      xtraeme   876:                     startup scripts</a></span></dt>
1.1       grant     877:                   </dl>
                    878:                 </dd>
                    879: 
1.30      wiz       880:                 <dt><span class="sect1"><a href=
1.38      dillo     881:                 "#feedback-to-author">15.6. Feedback to the
1.30      wiz       882:                 author</a></span></dt>
1.1       grant     883:               </dl>
                    884:             </dd>
                    885: 
1.38      dillo     886:             <dt><span class="chapter"><a href="#debug">16.
1.1       grant     887:             Debugging</a></span></dt>
                    888: 
1.38      dillo     889:             <dt><span class="chapter"><a href="#submit">17.
1.1       grant     890:             Submitting and Committing</a></span></dt>
                    891: 
                    892:             <dd>
                    893:               <dl>
1.30      wiz       894:                 <dt><span class="sect1"><a href=
1.38      dillo     895:                 "#submitting-your-package">17.1. Submitting your
1.30      wiz       896:                 packages</a></span></dt>
1.1       grant     897: 
1.30      wiz       898:                 <dt><span class="sect1"><a href=
1.41      wiz       899:                 "#general-notes-for-changes">17.2. General notes
                    900:                 when adding, updating, or removing
                    901:                 packages</a></span></dt>
                    902: 
                    903:                 <dt><span class="sect1"><a href=
                    904:                 "#committing-importing">17.3. Committing: Importing
1.30      wiz       905:                 a package into CVS</a></span></dt>
1.1       grant     906: 
1.30      wiz       907:                 <dt><span class="sect1"><a href=
1.41      wiz       908:                 "#updating-package">17.4. Updating a package to a
1.30      wiz       909:                 newer version</a></span></dt>
1.1       grant     910: 
1.30      wiz       911:                 <dt><span class="sect1"><a href=
1.41      wiz       912:                 "#moving-package">17.5. Moving a package in
1.30      wiz       913:                 pkgsrc</a></span></dt>
1.1       grant     914:               </dl>
                    915:             </dd>
                    916:           </dl>
                    917:         </dd>
                    918: 
1.46      gdt       919:         <dt><span class="appendix"><a href="#examples">A. A simple
1.1       grant     920:         example package: bison</a></span></dt>
                    921: 
                    922:         <dd>
                    923:           <dl>
1.46      gdt       924:             <dt><span class="sect1"><a href="#example-files">A.1.
1.1       grant     925:             files</a></span></dt>
                    926: 
                    927:             <dd>
                    928:               <dl>
1.30      wiz       929:                 <dt><span class="sect2"><a href=
1.46      gdt       930:                 "#example-Makefile">A.1.1. Makefile</a></span></dt>
1.1       grant     931: 
1.30      wiz       932:                 <dt><span class="sect2"><a href=
1.46      gdt       933:                 "#example-descr">A.1.2. DESCR</a></span></dt>
1.1       grant     934: 
1.30      wiz       935:                 <dt><span class="sect2"><a href=
1.46      gdt       936:                 "#example-plist">A.1.3. PLIST</a></span></dt>
1.1       grant     937: 
1.30      wiz       938:                 <dt><span class="sect2"><a href=
1.46      gdt       939:                 "#checking-package-with-pkglint">A.1.4. Checking a
1.30      wiz       940:                 package with <span><strong class=
1.14      xtraeme   941:                 "command">pkglint</strong></span></a></span></dt>
1.1       grant     942:               </dl>
                    943:             </dd>
                    944: 
1.46      gdt       945:             <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2.
1.30      wiz       946:             Steps for building, installing,
                    947:             packaging</a></span></dt>
1.1       grant     948:           </dl>
                    949:         </dd>
                    950: 
1.46      gdt       951:         <dt><span class="appendix"><a href="#logs">B. Build
1.1       grant     952:         logs</a></span></dt>
                    953: 
                    954:         <dd>
                    955:           <dl>
1.46      gdt       956:             <dt><span class="sect1"><a href="#logs.building">B.1.
1.1       grant     957:             Building figlet</a></span></dt>
                    958: 
1.46      gdt       959:             <dt><span class="sect1"><a href="#logs.package">B.2.
1.1       grant     960:             Packaging figlet</a></span></dt>
                    961:           </dl>
                    962:         </dd>
                    963: 
1.46      gdt       964:         <dt><span class="appendix"><a href="#ftp-layout">C. Layout
1.1       grant     965:         of the FTP server's package archive</a></span></dt>
1.2       hubertf   966: 
1.46      gdt       967:         <dt><span class="appendix"><a href="#editing">D. Editing
1.2       hubertf   968:         guidelines for the pkgsrc guide</a></span></dt>
                    969: 
                    970:         <dd>
                    971:           <dl>
1.46      gdt       972:             <dt><span class="sect1"><a href="#targets">D.1.
1.2       hubertf   973:             Targets</a></span></dt>
                    974: 
1.46      gdt       975:             <dt><span class="sect1"><a href="#procedure">D.2.
1.2       hubertf   976:             Procedure</a></span></dt>
                    977:           </dl>
                    978:         </dd>
1.1       grant     979:       </dl>
                    980:     </div>
                    981: 
1.52      tv        982:     <div class="chapter" lang="en">
1.1       grant     983:       <div class="titlepage">
                    984:         <div>
                    985:           <div>
1.52      tv        986:             <h2 class="title"><a name=
1.51      rillig    987:             "introduction"></a>Chapter&nbsp;1.&nbsp;What is
                    988:             pkgsrc?</h2>
1.1       grant     989:           </div>
                    990:         </div>
                    991:       </div>
                    992: 
                    993:       <div class="toc">
                    994:         <p><b>Table of Contents</b></p>
                    995: 
                    996:         <dl>
1.30      wiz       997:           <dt><span class="sect1"><a href=
                    998:           "#introduction-section">1.1. Introduction</a></span></dt>
1.1       grant     999: 
                   1000:           <dt><span class="sect1"><a href="#overview">1.2.
                   1001:           Overview</a></span></dt>
                   1002: 
                   1003:           <dt><span class="sect1"><a href="#terminology">1.3.
                   1004:           Terminology</a></span></dt>
                   1005: 
                   1006:           <dt><span class="sect1"><a href="#typography">1.4.
                   1007:           Typography</a></span></dt>
                   1008:         </dl>
                   1009:       </div>
                   1010: 
1.52      tv       1011:       <div class="sect1" lang="en">
1.1       grant    1012:         <div class="titlepage">
                   1013:           <div>
                   1014:             <div>
                   1015:               <h2 class="title" style="clear: both"><a name=
1.30      wiz      1016:               "introduction-section"></a>1.1.&nbsp;Introduction</h2>
1.1       grant    1017:             </div>
                   1018:           </div>
                   1019:         </div>
                   1020: 
1.47      reed     1021:         <p>There is a lot of software freely available for
                   1022:         Unix-based systems, which usually runs on NetBSD and other
1.1       grant    1023:         Unix-flavoured systems, too, sometimes with some
                   1024:         modifications. The NetBSD Packages Collection (pkgsrc)
                   1025:         incorporates any such changes necessary to make that
                   1026:         software run, and makes the installation (and
                   1027:         de-installation) of the software package easy by means of a
                   1028:         single command.</p>
                   1029: 
                   1030:         <p>Once the software has been built, it is manipulated with
1.14      xtraeme  1031:         the <span><strong class="command">pkg_*</strong></span>
                   1032:         tools so that installation and de-installation, printing of
                   1033:         an inventory of all installed packages and retrieval of
                   1034:         one-line comments or more verbose descriptions are all
                   1035:         simple.</p>
1.1       grant    1036: 
                   1037:         <p>pkgsrc currently contains several thousand packages,
                   1038:         including:</p>
                   1039: 
                   1040:         <div class="itemizedlist">
                   1041:           <ul type="disc">
                   1042:             <li>
                   1043:               <p><a xmlns=
                   1044:               "http://www.w3.org/TR/xhtml1/transitional" href=
                   1045:               "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/apache/README.html"
1.45      wiz      1046:               target="_top"><code xmlns="" class=
                   1047:               "filename">www/apache</code></a> - The Apache web
1.20      ben      1048:               server</p>
1.1       grant    1049:             </li>
                   1050: 
                   1051:             <li>
                   1052:               <p><a xmlns=
                   1053:               "http://www.w3.org/TR/xhtml1/transitional" href=
                   1054:               "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/mozilla/README.html"
1.45      wiz      1055:               target="_top"><code xmlns="" class=
                   1056:               "filename">www/mozilla</code></a> - The Mozilla web
1.20      ben      1057:               browser</p>
1.1       grant    1058:             </li>
                   1059: 
                   1060:             <li>
                   1061:               <p><a xmlns=
                   1062:               "http://www.w3.org/TR/xhtml1/transitional" href=
                   1063:               "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/meta-pkgs/gnome/README.html"
1.45      wiz      1064:               target="_top"><code xmlns="" class=
                   1065:               "filename">meta-pkgs/gnome</code></a> - The GNOME
1.20      ben      1066:               Desktop Environment</p>
1.1       grant    1067:             </li>
                   1068: 
                   1069:             <li>
                   1070:               <p><a xmlns=
                   1071:               "http://www.w3.org/TR/xhtml1/transitional" href=
                   1072:               "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/meta-pkgs/kde3/README.html"
1.45      wiz      1073:               target="_top"><code xmlns="" class=
                   1074:               "filename">meta-pkgs/kde3</code></a> - The K Desktop
1.20      ben      1075:               Environment</p>
1.1       grant    1076:             </li>
                   1077:           </ul>
                   1078:         </div>
                   1079: 
                   1080:         <p>...just to name a few.</p>
                   1081: 
                   1082:         <p>pkgsrc has built-in support for handling varying
                   1083:         dependencies, such as pthreads and X11, and extended
                   1084:         features such as IPv6 support on a range of platforms.</p>
                   1085: 
                   1086:         <p>pkgsrc was derived from FreeBSD's ports system, and
                   1087:         initially developed for NetBSD only. Since then, pkgsrc has
                   1088:         grown a lot, and now supports the following platforms:</p>
                   1089: 
                   1090:         <div class="itemizedlist">
                   1091:           <ul type="disc">
                   1092:             <li>
                   1093:               <p><a href="http://developer.apple.com/darwin/"
                   1094:               target="_top">Darwin</a> (<a href=
                   1095:               "http://www.apple.com/macosx/" target="_top">Mac OS
                   1096:               X</a>)</p>
                   1097:             </li>
                   1098: 
                   1099:             <li>
1.3       hubertf  1100:               <p><a href="http://www.DragonFlyBSD.org/" target=
                   1101:               "_top">DragonFlyBSD</a></p>
                   1102:             </li>
                   1103: 
                   1104:             <li>
1.1       grant    1105:               <p><a href="http://www.FreeBSD.org/" target=
                   1106:               "_top">FreeBSD</a></p>
                   1107:             </li>
                   1108: 
                   1109:             <li>
1.3       hubertf  1110:               <p>Microsoft Windows, via <a href=
                   1111:               "http://www.microsoft.com/windows/sfu/" target=
                   1112:               "_top">Interix</a></p>
1.1       grant    1113:             </li>
                   1114: 
                   1115:             <li>
                   1116:               <p><a href="http://www.sgi.com/software/irix6.5/"
                   1117:               target="_top">IRIX</a></p>
                   1118:             </li>
                   1119: 
                   1120:             <li>
                   1121:               <p><a href="http://www.linux.org/" target=
                   1122:               "_top">Linux</a></p>
                   1123:             </li>
                   1124: 
                   1125:             <li>
                   1126:               <p><a href="http://www.NetBSD.org/" target=
                   1127:               "_top">NetBSD</a> (of course)</p>
                   1128:             </li>
                   1129: 
                   1130:             <li>
1.17      sketch   1131:               <p><a href="http://h30097.www3.hp.com/" target=
                   1132:               "_top">Tru64</a> (Digital UNIX, OSF1)</p>
                   1133:             </li>
                   1134: 
                   1135:             <li>
1.1       grant    1136:               <p><a href="http://www.openbsd.org/" target=
                   1137:               "_top">OpenBSD</a></p>
                   1138:             </li>
                   1139: 
                   1140:             <li>
                   1141:               <p><a href="http://www.sun.com/solaris/" target=
                   1142:               "_top">Solaris</a></p>
                   1143:             </li>
                   1144:           </ul>
                   1145:         </div>
                   1146:       </div>
                   1147: 
1.52      tv       1148:       <div class="sect1" lang="en">
1.1       grant    1149:         <div class="titlepage">
                   1150:           <div>
                   1151:             <div>
                   1152:               <h2 class="title" style="clear: both"><a name=
1.52      tv       1153:               "overview"></a>1.2.&nbsp;Overview</h2>
1.1       grant    1154:             </div>
                   1155:           </div>
                   1156:         </div>
                   1157: 
                   1158:         <p>This document is divided into two parts. The first,
                   1159:         <a href="#users-guide" title=
1.46      gdt      1160:         "Part&nbsp;I.&nbsp;The pkgsrc user's guide">The pkgsrc
1.2       hubertf  1161:         user's guide</a>, describes how one can use one of the
                   1162:         packages in the Package Collection, either by installing a
                   1163:         precompiled binary package, or by building one's own copy
                   1164:         using the NetBSD package system. The second part, <a href=
1.1       grant    1165:         "#developers-guide" title=
1.46      gdt      1166:         "Part&nbsp;II.&nbsp;The pkgsrc developer's guide">The
                   1167:         pkgsrc developer's guide</a>, explains how to prepare a
                   1168:         package so it can be easily built by other NetBSD users
                   1169:         without knowing about the package's building details.</p>
1.1       grant    1170: 
                   1171:         <p>This document is available in various formats:</p>
                   1172: 
                   1173:         <div class="itemizedlist">
                   1174:           <ul type="disc">
                   1175:             <li>
                   1176:               <p><a href="index.html" target="_top">HTML</a></p>
                   1177:             </li>
                   1178: 
                   1179:             <li>
                   1180:               <p><a href="pkgsrc.pdf" target="_top">PDF</a></p>
                   1181:             </li>
                   1182: 
                   1183:             <li>
                   1184:               <p><a href="pkgsrc.ps" target="_top">PS</a></p>
                   1185:             </li>
                   1186: 
                   1187:             <li>
                   1188:               <p><a href="pkgsrc.txt" target="_top">TXT</a></p>
                   1189:             </li>
                   1190:           </ul>
                   1191:         </div>
                   1192:       </div>
                   1193: 
1.52      tv       1194:       <div class="sect1" lang="en">
1.1       grant    1195:         <div class="titlepage">
                   1196:           <div>
                   1197:             <div>
                   1198:               <h2 class="title" style="clear: both"><a name=
                   1199:               "terminology"></a>1.3.&nbsp;Terminology</h2>
                   1200:             </div>
                   1201:           </div>
                   1202:         </div>
                   1203: 
                   1204:         <p>There has been a lot of talk about &#8220;<span class=
                   1205:         "quote">ports</span>&#8221;, &#8220;<span class=
                   1206:         "quote">packages</span>&#8221;, etc. so far. Here is a
                   1207:         description of all the terminology used within this
                   1208:         document.</p>
                   1209: 
                   1210:         <div class="variablelist">
                   1211:           <dl>
                   1212:             <dt><span class="term">Package</span></dt>
                   1213: 
                   1214:             <dd>
                   1215:               <p>A set of files and building instructions that
                   1216:               describe what's necessary to build a certain piece of
                   1217:               software using pkgsrc. Packages are traditionally
1.45      wiz      1218:               stored under <code xmlns=
                   1219:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  1220:               "filename">/usr/pkgsrc</code>.</p>
1.1       grant    1221:             </dd>
                   1222: 
                   1223:             <dt><span class="term">The NetBSD package
                   1224:             system</span></dt>
                   1225: 
                   1226:             <dd>
                   1227:               <p>This is the former name of &#8220;<span class=
                   1228:               "quote">pkgsrc</span>&#8221;. It is part of the
1.27      rillig   1229:               NetBSD operating system and can be bootstrapped to
                   1230:               run on non-NetBSD operating systems as well. It
                   1231:               handles building (compiling), installing, and
                   1232:               removing of packages.</p>
1.1       grant    1233:             </dd>
                   1234: 
                   1235:             <dt><span class="term">Distfile</span></dt>
                   1236: 
                   1237:             <dd>
                   1238:               <p>This term describes the file or files that are
                   1239:               provided by the author of the piece of software to
                   1240:               distribute his work. All the changes necessary to
                   1241:               build on NetBSD are reflected in the corresponding
                   1242:               package. Usually the distfile is in the form of a
                   1243:               compressed tar-archive, but other types are possible,
1.45      wiz      1244:               too. Distfiles are usually stored below <code xmlns=
                   1245:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  1246:               "filename">/usr/pkgsrc/distfiles</code>.</p>
1.1       grant    1247:             </dd>
                   1248: 
                   1249:             <dt><span class="term">Port</span></dt>
                   1250: 
                   1251:             <dd>
                   1252:               <p>This is the term used by FreeBSD and OpenBSD
                   1253:               people for what we call a package. In NetBSD
                   1254:               terminology, &#8220;<span class=
                   1255:               "quote">port</span>&#8221; refers to a different
                   1256:               architecture.</p>
                   1257:             </dd>
                   1258: 
                   1259:             <dt><span class="term">Precompiled/binary
                   1260:             package</span></dt>
                   1261: 
                   1262:             <dd>
                   1263:               <p>A set of binaries built with pkgsrc from a
1.14      xtraeme  1264:               distfile and stuffed together in a single
1.45      wiz      1265:               <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   1266:               class="filename">.tgz</code> file so it can be
1.14      xtraeme  1267:               installed on machines of the same machine
                   1268:               architecture without the need to recompile. Packages
1.45      wiz      1269:               are usually generated in <code xmlns=
                   1270:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  1271:               "filename">/usr/pkgsrc/packages</code>; there is also
                   1272:               an archive on <a href=
1.1       grant    1273:               "ftp://ftp.NetBSD.org/pub/NetBSD/packages/" target=
                   1274:               "_top">ftp.NetBSD.org</a>.</p>
                   1275: 
                   1276:               <p>Sometimes, this is referred to by the term
                   1277:               &#8220;<span class="quote">package</span>&#8221; too,
                   1278:               especially in the context of precompiled
                   1279:               packages.</p>
                   1280:             </dd>
                   1281: 
                   1282:             <dt><span class="term">Program</span></dt>
                   1283: 
                   1284:             <dd>
                   1285:               <p>The piece of software to be installed which will
1.47      reed     1286:               be constructed from all the files in the distfile by
1.1       grant    1287:               the actions defined in the corresponding package.</p>
                   1288:             </dd>
                   1289:           </dl>
                   1290:         </div>
                   1291:       </div>
                   1292: 
1.52      tv       1293:       <div class="sect1" lang="en">
1.1       grant    1294:         <div class="titlepage">
                   1295:           <div>
                   1296:             <div>
                   1297:               <h2 class="title" style="clear: both"><a name=
                   1298:               "typography"></a>1.4.&nbsp;Typography</h2>
                   1299:             </div>
                   1300:           </div>
                   1301:         </div>
                   1302: 
                   1303:         <p>When giving examples for commands, shell prompts are
                   1304:         used to show if the command should/can be issued as root,
                   1305:         or if &#8220;<span class="quote">normal</span>&#8221; user
1.14      xtraeme  1306:         privileges are sufficient. We use a <code class=
                   1307:         "prompt">#</code> for root's shell prompt, and a
1.27      rillig   1308:         <code class="prompt">%</code> for users' shell prompt,
1.14      xtraeme  1309:         assuming they use the C-shell or tcsh.</p>
1.1       grant    1310:       </div>
                   1311:     </div>
                   1312: 
1.52      tv       1313:     <div class="part" lang="en">
1.1       grant    1314:       <div class="titlepage">
                   1315:         <div>
                   1316:           <div>
1.52      tv       1317:             <h1 class="title"><a name=
1.48      dillo    1318:             "users-guide"></a>Part&nbsp;I.&nbsp;The pkgsrc user's
                   1319:             guide</h1>
1.1       grant    1320:           </div>
                   1321:         </div>
                   1322:       </div>
                   1323: 
                   1324:       <div class="toc">
                   1325:         <p><b>Table of Contents</b></p>
                   1326: 
                   1327:         <dl>
                   1328:           <dt><span class="chapter"><a href="#getting">2. Where to
                   1329:           get pkgsrc</a></span></dt>
                   1330: 
                   1331:           <dd>
                   1332:             <dl>
1.30      wiz      1333:               <dt><span class="sect1"><a href="#as-tar-file">2.1.
                   1334:               As tar file</a></span></dt>
1.1       grant    1335: 
1.30      wiz      1336:               <dt><span class="sect1"><a href="#via-sup">2.2. Via
1.1       grant    1337:               SUP</a></span></dt>
                   1338: 
1.30      wiz      1339:               <dt><span class="sect1"><a href="#via-cvs">2.3. Via
1.1       grant    1340:               CVS</a></span></dt>
                   1341:             </dl>
                   1342:           </dd>
                   1343: 
                   1344:           <dt><span class="chapter"><a href="#platforms">3. Using
                   1345:           pkgsrc on systems other than NetBSD</a></span></dt>
                   1346: 
                   1347:           <dd>
                   1348:             <dl>
1.30      wiz      1349:               <dt><span class="sect1"><a href=
                   1350:               "#bootstrapping-pkgsrc">3.1. Bootstrapping
                   1351:               pkgsrc</a></span></dt>
1.1       grant    1352: 
1.30      wiz      1353:               <dt><span class="sect1"><a href=
1.47      reed     1354:               "#platform-specific-notes">3.2. Platform-specific
1.30      wiz      1355:               notes</a></span></dt>
1.1       grant    1356: 
                   1357:               <dd>
                   1358:                 <dl>
1.30      wiz      1359:                   <dt><span class="sect2"><a href="#darwin">3.2.1.
                   1360:                   Darwin (Mac OS X)</a></span></dt>
1.1       grant    1361: 
1.30      wiz      1362:                   <dt><span class="sect2"><a href="#freebsd">3.2.2.
                   1363:                   FreeBSD</a></span></dt>
1.22      tv       1364: 
1.30      wiz      1365:                   <dt><span class="sect2"><a href="#interix">3.2.3.
                   1366:                   Interix</a></span></dt>
1.1       grant    1367: 
1.30      wiz      1368:                   <dt><span class="sect2"><a href="#irix">3.2.4.
                   1369:                   IRIX</a></span></dt>
1.1       grant    1370: 
1.30      wiz      1371:                   <dt><span class="sect2"><a href="#linux">3.2.5.
                   1372:                   Linux</a></span></dt>
1.1       grant    1373: 
1.30      wiz      1374:                   <dt><span class="sect2"><a href="#openbsd">3.2.6.
                   1375:                   OpenBSD</a></span></dt>
1.1       grant    1376: 
1.30      wiz      1377:                   <dt><span class="sect2"><a href="#solaris">3.2.7.
                   1378:                   Solaris</a></span></dt>
1.1       grant    1379:                 </dl>
                   1380:               </dd>
                   1381:             </dl>
                   1382:           </dd>
                   1383: 
                   1384:           <dt><span class="chapter"><a href="#using">4. Using
                   1385:           pkgsrc</a></span></dt>
                   1386: 
                   1387:           <dd>
                   1388:             <dl>
                   1389:               <dt><span class="sect1"><a href=
                   1390:               "#getting-started">4.1. Working with binary
                   1391:               packages</a></span></dt>
                   1392: 
                   1393:               <dd>
                   1394:                 <dl>
                   1395:                   <dt><span class="sect2"><a href=
1.30      wiz      1396:                   "#where-to-get-binary-packages">4.1.1. Where to
                   1397:                   get binary packages</a></span></dt>
1.1       grant    1398: 
                   1399:                   <dt><span class="sect2"><a href=
1.30      wiz      1400:                   "#how-to-use-binary-packages">4.1.2. How to use
                   1401:                   binary packages</a></span></dt>
1.1       grant    1402: 
                   1403:                   <dt><span class="sect2"><a href=
1.30      wiz      1404:                   "#a-word-of-warning">4.1.3. A word of
1.1       grant    1405:                   warning</a></span></dt>
                   1406:                 </dl>
                   1407:               </dd>
                   1408: 
1.30      wiz      1409:               <dt><span class="sect1"><a href=
                   1410:               "#building-packages-from-source">4.2. Building
                   1411:               packages from source</a></span></dt>
1.1       grant    1412: 
                   1413:               <dd>
                   1414:                 <dl>
                   1415:                   <dt><span class="sect2"><a href=
1.30      wiz      1416:                   "#requirements">4.2.1.
                   1417:                   Requirements</a></span></dt>
1.1       grant    1418: 
                   1419:                   <dt><span class="sect2"><a href=
1.30      wiz      1420:                   "#fetching-distfiles">4.2.2. Fetching
1.1       grant    1421:                   distfiles</a></span></dt>
                   1422: 
                   1423:                   <dt><span class="sect2"><a href=
1.30      wiz      1424:                   "#how-to-build-and-install">4.2.3. How to build
                   1425:                   and install</a></span></dt>
1.1       grant    1426: 
                   1427:                   <dt><span class="sect2"><a href=
1.30      wiz      1428:                   "#selecting-the-compiler">4.2.4. Selecting the
1.1       grant    1429:                   compiler</a></span></dt>
                   1430:                 </dl>
                   1431:               </dd>
                   1432:             </dl>
                   1433:           </dd>
                   1434: 
1.38      dillo    1435:           <dt><span class="chapter"><a href="#configuring">5.
                   1436:           Configuring pkgsrc</a></span></dt>
                   1437: 
                   1438:           <dd>
                   1439:             <dl>
                   1440:               <dt><span class="sect1"><a href=
1.45      wiz      1441:               "#general-configuration">5.1. General
                   1442:               configuration</a></span></dt>
                   1443: 
                   1444:               <dt><span class="sect1"><a href=
                   1445:               "#variables-affecting-build">5.2. Variables affecting
                   1446:               the build process</a></span></dt>
                   1447: 
                   1448:               <dt><span class="sect1"><a href=
                   1449:               "#developer-advanced-settings">5.3.
                   1450:               Developer/advanced settings</a></span></dt>
                   1451: 
                   1452:               <dt><span class="sect1"><a href=
                   1453:               "#selecting-build-options">5.4. Selecting Build
1.42      dillo    1454:               Options</a></span></dt>
1.38      dillo    1455:             </dl>
                   1456:           </dd>
                   1457: 
                   1458:           <dt><span class="chapter"><a href="#binary">6. Creating
1.1       grant    1459:           binary packages</a></span></dt>
                   1460: 
                   1461:           <dd>
                   1462:             <dl>
1.30      wiz      1463:               <dt><span class="sect1"><a href=
1.38      dillo    1464:               "#building-a-single-binary-package">6.1. Building a
1.30      wiz      1465:               single binary package</a></span></dt>
1.1       grant    1466: 
1.30      wiz      1467:               <dt><span class="sect1"><a href=
1.38      dillo    1468:               "#settings-for-creationg-of-binary-packages">6.2.
1.1       grant    1469:               Settings for creation of binary
                   1470:               packages</a></span></dt>
                   1471: 
1.38      dillo    1472:               <dt><span class="sect1"><a href="#bulkbuild">6.3.
1.1       grant    1473:               Doing a bulk build of all packages</a></span></dt>
                   1474: 
                   1475:               <dd>
                   1476:                 <dl>
                   1477:                   <dt><span class="sect2"><a href=
1.38      dillo    1478:                   "#binary.configuration">6.3.1.
1.1       grant    1479:                   Configuration</a></span></dt>
                   1480: 
                   1481:                   <dt><span class="sect2"><a href=
1.38      dillo    1482:                   "#other-environmental-considerations">6.3.2.
1.30      wiz      1483:                   Other environmental
1.1       grant    1484:                   considerations</a></span></dt>
                   1485: 
                   1486:                   <dt><span class="sect2"><a href=
1.38      dillo    1487:                   "#operation">6.3.3. Operation</a></span></dt>
1.1       grant    1488: 
                   1489:                   <dt><span class="sect2"><a href=
1.38      dillo    1490:                   "#what-it-does">6.3.4. What it
1.30      wiz      1491:                   does</a></span></dt>
1.1       grant    1492: 
                   1493:                   <dt><span class="sect2"><a href=
1.38      dillo    1494:                   "#disk-space-requirements">6.3.5. Disk space
1.1       grant    1495:                   requirements</a></span></dt>
                   1496: 
                   1497:                   <dt><span class="sect2"><a href=
1.38      dillo    1498:                   "#setting-up-a-sandbox">6.3.6. Setting up a
1.47      reed     1499:                   sandbox for chrooted builds</a></span></dt>
1.1       grant    1500: 
                   1501:                   <dt><span class="sect2"><a href=
1.38      dillo    1502:                   "#building-a-partial-set">6.3.7. Building a
1.30      wiz      1503:                   partial set of packages</a></span></dt>
1.13      hubertf  1504: 
                   1505:                   <dt><span class="sect2"><a href=
1.38      dillo    1506:                   "#bulk-upload">6.3.8. Uploading results of a bulk
1.13      hubertf  1507:                   build</a></span></dt>
1.1       grant    1508:                 </dl>
                   1509:               </dd>
                   1510: 
1.30      wiz      1511:               <dt><span class="sect1"><a href=
1.38      dillo    1512:               "#creating-cdroms">6.4. Creating a multiple CD-ROM
1.30      wiz      1513:               packages collection</a></span></dt>
1.1       grant    1514: 
                   1515:               <dd>
                   1516:                 <dl>
                   1517:                   <dt><span class="sect2"><a href=
1.38      dillo    1518:                   "#cdpack-example">6.4.1. Example of
1.1       grant    1519:                   cdpack</a></span></dt>
                   1520:                 </dl>
                   1521:               </dd>
                   1522:             </dl>
                   1523:           </dd>
                   1524: 
1.38      dillo    1525:           <dt><span class="chapter"><a href="#faq">7. Frequently
1.1       grant    1526:           Asked Questions</a></span></dt>
                   1527: 
                   1528:           <dd>
                   1529:             <dl>
1.30      wiz      1530:               <dt><span class="sect1"><a href=
1.38      dillo    1531:               "#mailing-list-pointers">7.1. Are there any mailing
1.30      wiz      1532:               lists for pkg-related discussion?</a></span></dt>
1.1       grant    1533: 
1.38      dillo    1534:               <dt><span class="sect1"><a href="#pkgviews-docs">7.2.
1.1       grant    1535:               Where's the pkgviews documentation?</a></span></dt>
                   1536: 
1.38      dillo    1537:               <dt><span class="sect1"><a href="#faq-pkgtools">7.3.
1.1       grant    1538:               Utilities for package management
                   1539:               (pkgtools)</a></span></dt>
                   1540: 
1.30      wiz      1541:               <dt><span class="sect1"><a href=
1.38      dillo    1542:               "#non-root-pkgsrc">7.4. How to use pkgsrc as
1.30      wiz      1543:               non-root</a></span></dt>
1.1       grant    1544: 
1.30      wiz      1545:               <dt><span class="sect1"><a href=
1.38      dillo    1546:               "#resume-transfers">7.5. How to resume transfers when
1.30      wiz      1547:               fetching distfiles?</a></span></dt>
1.14      xtraeme  1548: 
1.30      wiz      1549:               <dt><span class="sect1"><a href=
1.38      dillo    1550:               "#XFree86-from-pkgsrc">7.6. How can I install/use
1.30      wiz      1551:               XFree86 from pkgsrc?</a></span></dt>
1.1       grant    1552: 
1.30      wiz      1553:               <dt><span class="sect1"><a href=
1.38      dillo    1554:               "#x.org-from-pkgsrc">7.7. How can I install/use X.org
1.30      wiz      1555:               from pkgsrc?</a></span></dt>
1.1       grant    1556: 
1.30      wiz      1557:               <dt><span class="sect1"><a href=
1.38      dillo    1558:               "#fetch-behind-firewall">7.8. How to fetch files from
1.30      wiz      1559:               behind a firewall</a></span></dt>
1.1       grant    1560: 
1.38      dillo    1561:               <dt><span class="sect1"><a href="#passive-ftp">7.9.
1.30      wiz      1562:               How do I tell <span><strong class="command">make
1.14      xtraeme  1563:               fetch</strong></span> to do passive
1.1       grant    1564:               FTP?</a></span></dt>
                   1565: 
1.30      wiz      1566:               <dt><span class="sect1"><a href=
1.38      dillo    1567:               "#fetching-all-distfiles">7.10. How to fetch all
1.30      wiz      1568:               distfiles at once</a></span></dt>
1.1       grant    1569: 
1.30      wiz      1570:               <dt><span class="sect1"><a href=
1.38      dillo    1571:               "#tmac.andoc-missing">7.11. What does
1.30      wiz      1572:               &#8220;<span class="quote">Don't know how to make
                   1573:               /usr/share/tmac/tmac.andoc</span>&#8221;
1.14      xtraeme  1574:               mean?</a></span></dt>
1.13      hubertf  1575: 
1.30      wiz      1576:               <dt><span class="sect1"><a href=
1.38      dillo    1577:               "#bsd.own.mk-missing">7.12. What does
1.30      wiz      1578:               &#8220;<span class="quote">Could not find
1.14      xtraeme  1579:               bsd.own.mk</span>&#8221; mean?</a></span></dt>
1.1       grant    1580: 
1.30      wiz      1581:               <dt><span class="sect1"><a href=
1.38      dillo    1582:               "#using-sudo-with-pkgsrc">7.13. Using 'sudo' with
1.30      wiz      1583:               pkgsrc</a></span></dt>
1.1       grant    1584: 
1.38      dillo    1585:               <dt><span class="sect1"><a href="#faq.conf">7.14. How
1.35      jmmv     1586:               do I change the location of configuration
                   1587:               files?</a></span></dt>
1.1       grant    1588: 
                   1589:               <dt><span class="sect1"><a href=
1.38      dillo    1590:               "#audit-packages">7.15. Automated security
1.1       grant    1591:               checks</a></span></dt>
                   1592:             </dl>
                   1593:           </dd>
                   1594:         </dl>
                   1595:       </div>
                   1596: 
1.52      tv       1597:       <div class="chapter" lang="en">
1.1       grant    1598:         <div class="titlepage">
                   1599:           <div>
                   1600:             <div>
1.52      tv       1601:               <h2 class="title"><a name=
1.1       grant    1602:               "getting"></a>Chapter&nbsp;2.&nbsp;Where to get
                   1603:               pkgsrc</h2>
                   1604:             </div>
                   1605:           </div>
                   1606:         </div>
                   1607: 
                   1608:         <div class="toc">
                   1609:           <p><b>Table of Contents</b></p>
                   1610: 
                   1611:           <dl>
1.30      wiz      1612:             <dt><span class="sect1"><a href="#as-tar-file">2.1. As
1.1       grant    1613:             tar file</a></span></dt>
                   1614: 
1.30      wiz      1615:             <dt><span class="sect1"><a href="#via-sup">2.2. Via
1.1       grant    1616:             SUP</a></span></dt>
                   1617: 
1.30      wiz      1618:             <dt><span class="sect1"><a href="#via-cvs">2.3. Via
1.1       grant    1619:             CVS</a></span></dt>
                   1620:           </dl>
                   1621:         </div>
                   1622: 
                   1623:         <p>There are three ways to get pkgsrc. Either as a tar
                   1624:         file, via SUP, or via CVS. All three ways are described
                   1625:         here.</p>
                   1626: 
1.52      tv       1627:         <div class="sect1" lang="en">
1.1       grant    1628:           <div class="titlepage">
                   1629:             <div>
                   1630:               <div>
                   1631:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       1632:                 "as-tar-file"></a>2.1.&nbsp;As tar file</h2>
1.1       grant    1633:               </div>
                   1634:             </div>
                   1635:           </div>
                   1636: 
                   1637:           <p>To get pkgsrc going, you need to get the pkgsrc.tar.gz
                   1638:           file from <a href=
1.11      ben      1639:           "ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-current/tar_files/pkgsrc.tar.gz"
1.20      ben      1640:           target="_top">ftp.NetBSD.org</a> and unpack it into
1.45      wiz      1641:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   1642:           class="filename">/usr/pkgsrc</code>.</p>
1.1       grant    1643:         </div>
                   1644: 
1.52      tv       1645:         <div class="sect1" lang="en">
1.1       grant    1646:           <div class="titlepage">
                   1647:             <div>
                   1648:               <div>
                   1649:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       1650:                 "via-sup"></a>2.2.&nbsp;Via SUP</h2>
1.1       grant    1651:               </div>
                   1652:             </div>
                   1653:           </div>
                   1654: 
                   1655:           <p>As an alternative to the tar file, you can get pkgsrc
                   1656:           via the Software Update Protocol, SUP. To do so, make
                   1657:           sure your supfile has a line</p>
                   1658:           <pre class="programlisting">
1.51      rillig   1659:     release=pkgsrc
1.1       grant    1660: </pre>
                   1661: 
1.45      wiz      1662:           <p>in it, see the examples in <code xmlns=
                   1663:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  1664:           "filename">/usr/share/examples/supfiles</code>, and that
1.45      wiz      1665:           the <code xmlns=
                   1666:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   1667:           "filename">/usr/pkgsrc</code> directory exists. Then,
                   1668:           simply run <span><strong class="command">sup -v
                   1669:           <em class="replaceable"><code>/path/to/your/supfile</code></em></strong></span>.</p>
1.1       grant    1670:         </div>
                   1671: 
1.52      tv       1672:         <div class="sect1" lang="en">
1.1       grant    1673:           <div class="titlepage">
                   1674:             <div>
                   1675:               <div>
                   1676:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       1677:                 "via-cvs"></a>2.3.&nbsp;Via CVS</h2>
1.1       grant    1678:               </div>
                   1679:             </div>
                   1680:           </div>
                   1681: 
                   1682:           <p>To get pkgsrc via CVS, make sure you have
                   1683:           &#8220;<span class="quote">cvs</span>&#8221; installed.
1.27      rillig   1684:           To do an initial (full) checkout of pkgsrc, do the
                   1685:           following steps:</p>
1.1       grant    1686:           <pre class="screen">
1.14      xtraeme  1687: <code class="prompt">%</code> <strong class=
                   1688: "userinput"><code>setenv CVSROOT anoncvs@anoncvs.NetBSD.org:/cvsroot</code></strong>
                   1689: <code class="prompt">%</code> <strong class=
                   1690: "userinput"><code>setenv CVS_RSH ssh</code></strong>
                   1691: <code class="prompt">%</code> <strong class=
                   1692: "userinput"><code>cd /usr</code></strong>
                   1693: <code class="prompt">%</code> <strong class=
                   1694: "userinput"><code>cvs checkout -P pkgsrc</code></strong>
                   1695: </pre>
                   1696: 
1.45      wiz      1697:           <p>This will create the <code xmlns=
                   1698:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   1699:           "filename">pkgsrc</code> directory in your <code xmlns=
                   1700:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  1701:           "filename">/usr</code>, and all the package source will
1.45      wiz      1702:           be stored under <code xmlns=
                   1703:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  1704:           "filename">/usr/pkgsrc</code>. To update pkgsrc after the
                   1705:           initial checkout, make sure you have <code class=
                   1706:           "varname">CVS_RSH</code> set as above, then do:</p>
1.1       grant    1707:           <pre class="screen">
1.14      xtraeme  1708: <code class="prompt">%</code> <strong class=
                   1709: "userinput"><code>cd /usr/pkgsrc</code></strong>
                   1710: <code class="prompt">%</code> <strong class=
                   1711: "userinput"><code>cvs -q update -dP</code></strong>
1.1       grant    1712: </pre>
                   1713: 
                   1714:           <p>Please also note that it is possible to have multiple
                   1715:           copies of the pkgsrc hierarchy in use at any one time -
                   1716:           all work is done relatively within the pkgsrc tree.</p>
                   1717:         </div>
                   1718:       </div>
                   1719: 
1.52      tv       1720:       <div class="chapter" lang="en">
1.1       grant    1721:         <div class="titlepage">
                   1722:           <div>
                   1723:             <div>
1.52      tv       1724:               <h2 class="title"><a name=
1.1       grant    1725:               "platforms"></a>Chapter&nbsp;3.&nbsp;Using pkgsrc on
                   1726:               systems other than NetBSD</h2>
                   1727:             </div>
                   1728:           </div>
                   1729:         </div>
                   1730: 
                   1731:         <div class="toc">
                   1732:           <p><b>Table of Contents</b></p>
                   1733: 
                   1734:           <dl>
1.30      wiz      1735:             <dt><span class="sect1"><a href=
                   1736:             "#bootstrapping-pkgsrc">3.1. Bootstrapping
                   1737:             pkgsrc</a></span></dt>
1.1       grant    1738: 
1.30      wiz      1739:             <dt><span class="sect1"><a href=
1.47      reed     1740:             "#platform-specific-notes">3.2. Platform-specific
1.30      wiz      1741:             notes</a></span></dt>
1.1       grant    1742: 
                   1743:             <dd>
                   1744:               <dl>
1.30      wiz      1745:                 <dt><span class="sect2"><a href="#darwin">3.2.1.
1.1       grant    1746:                 Darwin (Mac OS X)</a></span></dt>
                   1747: 
1.30      wiz      1748:                 <dt><span class="sect2"><a href="#freebsd">3.2.2.
1.1       grant    1749:                 FreeBSD</a></span></dt>
                   1750: 
1.30      wiz      1751:                 <dt><span class="sect2"><a href="#interix">3.2.3.
1.1       grant    1752:                 Interix</a></span></dt>
                   1753: 
1.30      wiz      1754:                 <dt><span class="sect2"><a href="#irix">3.2.4.
1.1       grant    1755:                 IRIX</a></span></dt>
                   1756: 
1.30      wiz      1757:                 <dt><span class="sect2"><a href="#linux">3.2.5.
1.22      tv       1758:                 Linux</a></span></dt>
                   1759: 
1.30      wiz      1760:                 <dt><span class="sect2"><a href="#openbsd">3.2.6.
1.1       grant    1761:                 OpenBSD</a></span></dt>
                   1762: 
1.30      wiz      1763:                 <dt><span class="sect2"><a href="#solaris">3.2.7.
1.1       grant    1764:                 Solaris</a></span></dt>
                   1765:               </dl>
                   1766:             </dd>
                   1767:           </dl>
                   1768:         </div>
                   1769: 
1.52      tv       1770:         <div class="sect1" lang="en">
1.1       grant    1771:           <div class="titlepage">
                   1772:             <div>
                   1773:               <div>
                   1774:                 <h2 class="title" style="clear: both"><a name=
1.30      wiz      1775:                 "bootstrapping-pkgsrc"></a>3.1.&nbsp;Bootstrapping
                   1776:                 pkgsrc</h2>
1.1       grant    1777:               </div>
                   1778:             </div>
                   1779:           </div>
                   1780: 
1.27      rillig   1781:           <p>For operating systems other than NetBSD, we provide a
1.1       grant    1782:           bootstrap kit to build the required tools to use pkgsrc
                   1783:           on your platform. Besides support for native NetBSD,
                   1784:           pkgsrc and the bootstrap kit have support for the
                   1785:           following operating systems:</p>
                   1786: 
                   1787:           <div class="itemizedlist">
                   1788:             <ul type="disc">
                   1789:               <li>
                   1790:                 <p>Darwin (Mac OS X)</p>
                   1791:               </li>
                   1792: 
                   1793:               <li>
1.16      grant    1794:                 <p>DragonFlyBSD</p>
                   1795:               </li>
                   1796: 
                   1797:               <li>
1.1       grant    1798:                 <p>FreeBSD</p>
                   1799:               </li>
                   1800: 
                   1801:               <li>
                   1802:                 <p>Interix (Windows 2000, XP, 2003)</p>
                   1803:               </li>
                   1804: 
                   1805:               <li>
                   1806:                 <p>IRIX</p>
                   1807:               </li>
                   1808: 
                   1809:               <li>
                   1810:                 <p>Linux</p>
                   1811:               </li>
                   1812: 
                   1813:               <li>
                   1814:                 <p>OpenBSD</p>
                   1815:               </li>
                   1816: 
                   1817:               <li>
                   1818:                 <p>Solaris</p>
                   1819:               </li>
1.16      grant    1820: 
                   1821:               <li>
                   1822:                 <p>Tru64 (Digital UNIX/OSF1)</p>
                   1823:               </li>
1.1       grant    1824:             </ul>
                   1825:           </div>
                   1826: 
                   1827:           <p>Support for other platforms is under development.</p>
                   1828: 
                   1829:           <p>Installing the bootstrap kit should be as simple
                   1830:           as:</p>
                   1831:           <pre class="screen">
1.14      xtraeme  1832: <code class="prompt">#</code> <strong class=
                   1833: "userinput"><code>env CVS_RSH=ssh cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout pkgsrc</code></strong>
                   1834: <code class="prompt">#</code> <strong class=
                   1835: "userinput"><code>cd pkgsrc/bootstrap</code></strong>
                   1836: <code class="prompt">#</code> <strong class=
                   1837: "userinput"><code>./bootstrap</code></strong>
1.1       grant    1838: </pre>
                   1839: 
                   1840:           <p>See <a href="#getting" title=
1.52      tv       1841:           "Chapter&nbsp;2.&nbsp;Where to get pkgsrc">Chapter&nbsp;2,
1.1       grant    1842:           <i>Where to get pkgsrc</i></a> for other ways to get
1.14      xtraeme  1843:           pkgsrc before bootstrapping. The given
                   1844:           <span><strong class="command">bootstrap</strong></span>
1.45      wiz      1845:           command will use the defaults of <code xmlns=
                   1846:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  1847:           "filename">/usr/pkg</code> for the <span class=
                   1848:           "emphasis"><em>prefix</em></span> where programs will be
1.45      wiz      1849:           installed in, and <code xmlns=
                   1850:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  1851:           "filename">/var/db/pkg</code> for the package database
1.27      rillig   1852:           directory where pkgsrc will do its internal bookkeeping.
1.1       grant    1853:           However, these can also be set using command-line
1.27      rillig   1854:           arguments.</p>
1.1       grant    1855: 
                   1856:           <p>Binary packages for the pkgsrc tools and an initial
                   1857:           set of packages is available for supported platforms. An
                   1858:           up-to-date list of these can be found on <a href=
                   1859:           "http://www.pkgsrc.org/" target=
                   1860:           "_top">www.pkgsrc.org</a>.</p>
1.47      reed     1861: 
                   1862:           <div class="note" style=
                   1863:           "margin-left: 0.5in; margin-right: 0.5in;">
                   1864:             <h3 class="title">Note</h3>
                   1865: 
                   1866:             <p>The bootstrap installs a <span><strong class=
                   1867:             "command">bmake</strong></span> tool. Use this
                   1868:             <span><strong class="command">bmake</strong></span>
                   1869:             when building via pkgsrc. For examples in this guide,
                   1870:             use <span><strong class="command">bmake</strong></span>
                   1871:             instead of &#8220;<span class=
                   1872:             "quote">make</span>&#8221;.</p>
                   1873:           </div>
1.1       grant    1874:         </div>
                   1875: 
1.52      tv       1876:         <div class="sect1" lang="en">
1.1       grant    1877:           <div class="titlepage">
                   1878:             <div>
                   1879:               <div>
                   1880:                 <h2 class="title" style="clear: both"><a name=
1.47      reed     1881:                 "platform-specific-notes"></a>3.2.&nbsp;Platform-specific
                   1882:                 notes</h2>
1.1       grant    1883:               </div>
                   1884:             </div>
                   1885:           </div>
                   1886: 
                   1887:           <p>Here are some platform-specific notes you should be
                   1888:           aware of.</p>
                   1889: 
1.52      tv       1890:           <div class="sect2" lang="en">
1.1       grant    1891:             <div class="titlepage">
                   1892:               <div>
                   1893:                 <div>
1.52      tv       1894:                   <h3 class="title"><a name=
1.30      wiz      1895:                   "darwin"></a>3.2.1.&nbsp;Darwin (Mac OS X)</h3>
1.1       grant    1896:                 </div>
                   1897:               </div>
                   1898:             </div>
                   1899: 
                   1900:             <p>Darwin 5.x and 6.x are supported. There are two
                   1901:             methods of using pkgsrc on Mac OS X, by using a
                   1902:             <a href="#platform.osx-image" title=
                   1903:             "3.2.1.1.&nbsp;Using a disk image">disk image</a>, or a
                   1904:             <a href="#platform.osx-ufs" title=
                   1905:             "3.2.1.2.&nbsp;Using a UFS partition">UFS
                   1906:             partition</a>.</p>
                   1907: 
                   1908:             <p>Before you start, you will need to download and
                   1909:             install the Mac OS X Developer Tools from Apple's
                   1910:             Developer Connection. See <a href=
                   1911:             "http://developer.apple.com/macosx/" target=
                   1912:             "_top">http://developer.apple.com/macosx/</a> for
                   1913:             details. Also, make sure you install X11 for Mac OS X
                   1914:             and the X11 SDK from <a href=
                   1915:             "http://www.apple.com/macosx/x11/download/" target=
                   1916:             "_top">http://www.apple.com/macosx/x11/download/</a> if
                   1917:             you intend to build packages that use the X11 Window
                   1918:             System.</p>
                   1919: 
                   1920:             <p>If you already have a UFS partition, or have a spare
                   1921:             partition that you can format as UFS, it is recommended
                   1922:             to use that instead of the disk image. It'll be
                   1923:             somewhat faster and will mount automatically at boot
                   1924:             time, where you must manually mount a disk image.</p>
                   1925: 
                   1926:             <div class="note" style=
                   1927:             "margin-left: 0.5in; margin-right: 0.5in;">
                   1928:               <h3 class="title">Note</h3>
                   1929: 
                   1930:               <p>You cannot use a HFS+ file system for pkgsrc,
1.47      reed     1931:               because pkgsrc currently requires the file system to
1.1       grant    1932:               be case-sensitive, and HFS+ is not.</p>
                   1933:             </div>
                   1934: 
1.52      tv       1935:             <div class="sect3" lang="en">
1.1       grant    1936:               <div class="titlepage">
                   1937:                 <div>
                   1938:                   <div>
1.52      tv       1939:                     <h4 class="title"><a name=
                   1940:                     "platform.osx-image"></a>3.2.1.1.&nbsp;Using a
                   1941:                     disk image</h4>
1.1       grant    1942:                   </div>
                   1943:                 </div>
                   1944:               </div>
                   1945: 
                   1946:               <p>Create the disk image:</p>
                   1947:               <pre class="screen">
1.14      xtraeme  1948: <code class="prompt">#</code> <strong class=
                   1949: "userinput"><code>cd pkgsrc/bootstrap</code></strong>
                   1950: <code class="prompt">#</code> <strong class=
                   1951: "userinput"><code>./ufsdiskimage create ~/Documents/NetBSD 512</code></strong> # megabytes - season to taste
                   1952: <code class="prompt">#</code> <strong class=
                   1953: "userinput"><code>./ufsdiskimage mount ~/Documents/NetBSD</code></strong>
                   1954: <code class="prompt">#</code> <strong class=
                   1955: "userinput"><code>sudo chown `id -u`:`id -g` /Volumes/NetBSD</code></strong>
1.1       grant    1956: </pre>
                   1957: 
                   1958:               <p>That's it!</p>
                   1959:             </div>
                   1960: 
1.52      tv       1961:             <div class="sect3" lang="en">
1.1       grant    1962:               <div class="titlepage">
                   1963:                 <div>
                   1964:                   <div>
1.52      tv       1965:                     <h4 class="title"><a name=
                   1966:                     "platform.osx-ufs"></a>3.2.1.2.&nbsp;Using a
1.1       grant    1967:                     UFS partition</h4>
                   1968:                   </div>
                   1969:                 </div>
                   1970:               </div>
                   1971: 
1.45      wiz      1972:               <p>By default, <code xmlns=
                   1973:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   1974:               "filename">/usr</code> will be on your root file
                   1975:               system, normally HFS+. It is possible to use the
                   1976:               default <span class="emphasis"><em>prefix</em></span>
                   1977:               of <code xmlns=
                   1978:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   1979:               "filename">/usr/pkg</code> by symlinking <code xmlns=
                   1980:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  1981:               "filename">/usr/pkg</code> to a directory on a UFS
                   1982:               file system. Obviously, another symlink is required
                   1983:               if you want to place the package database directory
                   1984:               outside the <span class=
                   1985:               "emphasis"><em>prefix</em></span>. e.g.</p>
1.1       grant    1986:               <pre class="screen">
1.14      xtraeme  1987: <code class="prompt">#</code> <strong class=
1.22      tv       1988: "userinput"><code>./bootstrap --pkgdbdir /usr/pkg/pkgdb --pkgsrcdir /Volumes/ufs/pkgsrc</code></strong>
1.1       grant    1989: </pre>
                   1990: 
                   1991:               <p>If you created your partitions at the time of
                   1992:               installing Mac OS X and formatted the target
                   1993:               partition as UFS, it should automatically mount on
1.45      wiz      1994:               <code xmlns=
                   1995:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   1996:               "filename">/Volumes/&lt;volume name&gt;</code> when
                   1997:               the machine boots. If you are (re)formatting a
                   1998:               partition as UFS, you need to ensure that the
                   1999:               partition map correctly reflects &#8220;<span class=
                   2000:               "quote">Apple_UFS</span>&#8221; and not
                   2001:               &#8220;<span class=
1.1       grant    2002:               "quote">Apple_HFS</span>&#8221;.</p>
                   2003: 
                   2004:               <p>The problem is that none of the disk tools will
                   2005:               let you touch a disk that is booted from. You can
                   2006:               unmount the partition, but even if you newfs it, the
                   2007:               partition type will be incorrect and the automounter
                   2008:               won't mount it. It can be mounted manually, but it
                   2009:               won't appear in Finder.</p>
                   2010: 
                   2011:               <p>You'll need to boot off of the OS X Installation
                   2012:               (User) CD. When the Installation program starts, go
                   2013:               up to the menu and select Disk Utility. Now, you will
                   2014:               be able to select the partition you want to be UFS,
                   2015:               and Format it Apple UFS. Quit the Disk Utility, quit
                   2016:               the installer which will reboot your machine. The new
                   2017:               UFS file system will appear in Finder.</p>
                   2018: 
                   2019:               <p>Be aware that the permissions on the new file
                   2020:               system will be writable by root only.</p>
                   2021: 
                   2022:               <p>This note is as of 10.2 (Jaguar) and applies to
                   2023:               earlier versions. Hopefully Apple will fix Disk
                   2024:               Utility in 10.3 (Panther).</p>
                   2025:             </div>
                   2026:           </div>
                   2027: 
1.52      tv       2028:           <div class="sect2" lang="en">
1.1       grant    2029:             <div class="titlepage">
                   2030:               <div>
                   2031:                 <div>
1.52      tv       2032:                   <h3 class="title"><a name=
1.30      wiz      2033:                   "freebsd"></a>3.2.2.&nbsp;FreeBSD</h3>
1.1       grant    2034:                 </div>
                   2035:               </div>
                   2036:             </div>
                   2037: 
                   2038:             <p>FreeBSD 4.7 and 5.0 have been tested and are
                   2039:             supported, other versions may work.</p>
                   2040: 
                   2041:             <p>Care should be taken so that the tools that this kit
                   2042:             installs do not conflict with the FreeBSD userland
                   2043:             tools. There are several steps:</p>
                   2044: 
                   2045:             <div class="orderedlist">
                   2046:               <ol type="1">
                   2047:                 <li>
                   2048:                   <p>FreeBSD stores its ports pkg database in
1.45      wiz      2049:                   <code xmlns=
                   2050:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   2051:                   "filename">/var/db/pkg</code>. It is therefore
                   2052:                   recommended that you choose a different location
                   2053:                   (e.g. <code xmlns=
                   2054:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2055:                   "filename">/usr/pkgdb</code>) by using the
1.1       grant    2056:                   --pkgdbdir option to the bootstrap script.</p>
                   2057:                 </li>
                   2058: 
                   2059:                 <li>
                   2060:                   <p>If you do not intend to use the FreeBSD ports
                   2061:                   tools, it's probably a good idea to move them out
                   2062:                   of the way to avoid confusion, e.g.</p>
                   2063:                   <pre class="screen">
1.14      xtraeme  2064: <code class="prompt">#</code> <strong class=
                   2065: "userinput"><code>cd /usr/sbin</code></strong>
                   2066: <code class="prompt">#</code> <strong class=
                   2067: "userinput"><code>mv pkg_add pkg_add.orig</code></strong>
                   2068: <code class="prompt">#</code> <strong class=
                   2069: "userinput"><code>mv pkg_create pkg_create.orig</code></strong>
                   2070: <code class="prompt">#</code> <strong class=
                   2071: "userinput"><code>mv pkg_delete pkg_delete.orig</code></strong>
                   2072: <code class="prompt">#</code> <strong class=
                   2073: "userinput"><code>mv pkg_info pkg_info.orig</code></strong>
1.1       grant    2074: </pre>
                   2075:                 </li>
                   2076: 
                   2077:                 <li>
1.45      wiz      2078:                   <p>An example <code xmlns=
                   2079:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2080:                   "filename">/etc/mk.conf</code> file will be
1.45      wiz      2081:                   placed in <code xmlns=
                   2082:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2083:                   "filename">/etc/mk.conf.example</code> file when
                   2084:                   you use the bootstrap script.</p>
1.1       grant    2085:                 </li>
                   2086:               </ol>
                   2087:             </div>
                   2088:           </div>
                   2089: 
1.52      tv       2090:           <div class="sect2" lang="en">
1.1       grant    2091:             <div class="titlepage">
                   2092:               <div>
                   2093:                 <div>
1.52      tv       2094:                   <h3 class="title"><a name=
1.30      wiz      2095:                   "interix"></a>3.2.3.&nbsp;Interix</h3>
1.1       grant    2096:                 </div>
                   2097:               </div>
                   2098:             </div>
                   2099: 
1.47      reed     2100:             <p>Interix is a POSIX-compatible subsystem for the
1.1       grant    2101:             Windows NT kernel, providing a Unix-like environment
                   2102:             with a tighter kernel integration than available with
                   2103:             Cygwin. It is part of the Windows Services for Unix
                   2104:             package, available for free for any licensed copy of
1.22      tv       2105:             Windows 2000, XP (not including XP Home), or 2003. SFU
                   2106:             can be downloaded from <a href=
                   2107:             "http://www.microsoft.com/windows/sfu/" target=
1.1       grant    2108:             "_top">http://www.microsoft.com/windows/sfu/</a>.</p>
                   2109: 
                   2110:             <p>Services for Unix 3.5, current as of this writing,
                   2111:             has been tested. 3.0 or 3.1 may work, but are not
                   2112:             officially supported. (The main difference in 3.0/3.1
                   2113:             is lack of pthreads.)</p>
                   2114: 
1.52      tv       2115:             <div class="sect3" lang="en">
1.1       grant    2116:               <div class="titlepage">
                   2117:                 <div>
                   2118:                   <div>
                   2119:                     <h4 class="title"><a name=
                   2120:                     "platform.interix-sfu-install"></a>3.2.3.1.&nbsp;When
1.2       hubertf  2121:                     installing Interix/SFU</h4>
1.1       grant    2122:                   </div>
                   2123:                 </div>
                   2124:               </div>
                   2125: 
                   2126:               <p>At an absolute minimum, the following packages
                   2127:               must be installed from the Windows Services for Unix
                   2128:               3.5 distribution in order to use pkgsrc:</p>
                   2129: 
                   2130:               <div class="itemizedlist">
                   2131:                 <ul type="disc">
                   2132:                   <li>
                   2133:                     <p>Utilities -&gt; Base Utilities</p>
                   2134:                   </li>
                   2135: 
                   2136:                   <li>
                   2137:                     <p>Interix GNU Components -&gt; (all)</p>
                   2138:                   </li>
                   2139: 
                   2140:                   <li>
                   2141:                     <p>Remote Connectivity</p>
                   2142:                   </li>
                   2143: 
                   2144:                   <li>
                   2145:                     <p>Interix SDK</p>
                   2146:                   </li>
                   2147:                 </ul>
                   2148:               </div>
                   2149: 
                   2150:               <p>When using pkgsrc on Interix, DO NOT install the
                   2151:               Utilities subcomponent "UNIX Perl". That is Perl 5.6
                   2152:               without shared module support, installed to
                   2153:               /usr/local, and will only cause confusion. Instead,
                   2154:               install Perl 5.8 from pkgsrc (or from a binary
                   2155:               package).</p>
                   2156: 
                   2157:               <p>The Remote Connectivity subcomponent "Windows
                   2158:               Remote Shell Service" does not need to be installed,
                   2159:               but Remote Connectivity itself should be installed in
                   2160:               order to have a working inetd.</p>
                   2161: 
1.52      tv       2162:               <p>During installation you may be asked whether to
                   2163:               enable setuid behavior for Interix programs, and
                   2164:               whether to make pathnames default to case-sensitive.
                   2165:               Setuid should be enabled, and case-sensitivity MUST
                   2166:               be enabled. (Without case-sensitivity, a large number
                   2167:               of packages including perl will not build.)</p>
                   2168: 
                   2169:               <p>NOTE: Newer Windows service packs change the way
                   2170:               binary execution works (via the Data Execution
                   2171:               Prevention feature). In order to use pkgsrc and other
                   2172:               gcc-compiled binaries reliably, a hotfix containing
                   2173:               POSIX.EXE, PSXDLL.DLL, PSXRUN.EXE, and PSXSS.EXE
                   2174:               (899522 or newer) must be installed. Hotfixes are
                   2175:               available from Microsoft through a support contract;
                   2176:               however, a NetBSD developer has made most Interix
                   2177:               hotfixes available for personal use from <a href=
                   2178:               "http://www.duh.org/interix/hotfixes.php" target=
                   2179:               "_top">http://www.duh.org/interix/hotfixes.php</a>.</p>
1.1       grant    2180:             </div>
                   2181: 
1.52      tv       2182:             <div class="sect3" lang="en">
1.1       grant    2183:               <div class="titlepage">
                   2184:                 <div>
                   2185:                   <div>
                   2186:                     <h4 class="title"><a name=
                   2187:                     "platform.interix-sfu-postinstall"></a>3.2.3.2.&nbsp;What
                   2188:                     to do if Interix/SFU is already installed</h4>
                   2189:                   </div>
                   2190:                 </div>
                   2191:               </div>
                   2192: 
                   2193:               <p>If SFU is already installed and you wish to alter
                   2194:               these settings to work with pkgsrc, note the
                   2195:               following things.</p>
                   2196: 
                   2197:               <div class="itemizedlist">
                   2198:                 <ul type="disc">
                   2199:                   <li>
                   2200:                     <p>To uninstall UNIX Perl, use Add/Remove
                   2201:                     Programs, select Microsoft Windows Services for
                   2202:                     UNIX, then click Change. In the installer,
                   2203:                     choose Add or Remove, then uncheck
                   2204:                     Utilities-&gt;UNIX Perl.</p>
                   2205:                   </li>
                   2206: 
                   2207:                   <li>
1.47      reed     2208:                     <p>To enable case-sensitivity for the file
                   2209:                     system, run REGEDIT.EXE, and change the
1.1       grant    2210:                     following registry key:</p>
                   2211: 
                   2212:                     <p>
                   2213:                     HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
                   2214:                     Manager\kernel</p>
                   2215: 
                   2216:                     <p>Set the DWORD value "obcaseinsensitive" to
                   2217:                     0; then reboot.</p>
                   2218:                   </li>
                   2219: 
                   2220:                   <li>
                   2221:                     <p>To enable setuid binaries (optional), run
                   2222:                     REGEDIT.EXE, and change the following registry
                   2223:                     key:</p>
                   2224: 
                   2225:                     <p>
                   2226:                     HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Services
                   2227:                     for UNIX</p>
                   2228: 
                   2229:                     <p>Set the DWORD value "EnableSetuidBinaries"
                   2230:                     to 1; then reboot.</p>
                   2231:                   </li>
                   2232:                 </ul>
                   2233:               </div>
                   2234:             </div>
                   2235: 
1.52      tv       2236:             <div class="sect3" lang="en">
1.1       grant    2237:               <div class="titlepage">
                   2238:                 <div>
                   2239:                   <div>
                   2240:                     <h4 class="title"><a name=
                   2241:                     "platform.interix-notes"></a>3.2.3.3.&nbsp;Important
                   2242:                     notes for using pkgsrc</h4>
                   2243:                   </div>
                   2244:                 </div>
                   2245:               </div>
                   2246: 
1.52      tv       2247:               <p>The package manager (either the pkgsrc "su" user,
1.1       grant    2248:               or the user running "pkg_add") must be a member of
                   2249:               the local Administrators group. Such a user must also
                   2250:               be used to run the bootstrap. This is slightly
                   2251:               relaxed from the normal pkgsrc requirement of
                   2252:               "root".</p>
                   2253: 
                   2254:               <p>The package manager should use a umask of 002.
                   2255:               "make install" will automatically complain if this is
                   2256:               not the case. This ensures that directories written
                   2257:               in /var/db/pkg are Administrators-group
                   2258:               writeable.</p>
                   2259: 
                   2260:               <p>The popular Interix binary packages from
                   2261:               http://www.interopsystems.com/ use an older version
                   2262:               of pkgsrc's pkg_* tools. Ideally, these should NOT be
                   2263:               used in conjunction with pkgsrc. If you choose to use
                   2264:               them at the same time as the pkgsrc packages, ensure
                   2265:               that you use the proper pkg_* tools for each type of
                   2266:               binary package.</p>
1.22      tv       2267: 
                   2268:               <p>The TERM setting used for DOS-type console windows
                   2269:               (including those invoked by the csh and ksh startup
                   2270:               shortcuts) is "interix". Most systems don't have a
                   2271:               termcap/terminfo entry for it, but the following
                   2272:               .termcap entry provides adequate emulation in most
                   2273:               cases:</p>
                   2274:               <pre class="programlisting">
1.51      rillig   2275:     interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi:
1.22      tv       2276: </pre>
1.1       grant    2277:             </div>
1.52      tv       2278: 
                   2279:             <div class="sect3" lang="en">
                   2280:               <div class="titlepage">
                   2281:                 <div>
                   2282:                   <div>
                   2283:                     <h4 class="title"><a name=
                   2284:                     "platform.interix-limits"></a>3.2.3.4.&nbsp;Limitations
                   2285:                     of the Interix platform</h4>
                   2286:                   </div>
                   2287:                 </div>
                   2288:               </div>
                   2289: 
                   2290:               <p>Though Interix suffices as a familiar and flexible
                   2291:               substitute for a full Unix-like platform, it has some
                   2292:               drawbacks that should be noted for those desiring to
                   2293:               make the most of Interix.</p>
                   2294: 
                   2295:               <div class="itemizedlist">
                   2296:                 <ul type="disc">
                   2297:                   <li>
                   2298:                     <span class=
                   2299:                     "strong"><strong>X-Windows:</strong></span>
                   2300: 
                   2301:                     <p>Interix comes with the standard set of X11R6
                   2302:                     client libraries, and can run X-Windows based
                   2303:                     applications, but it does <span class=
                   2304:                     "emphasis"><em>not</em></span> come with an X
                   2305:                     server. Some options are <a href=
                   2306:                     "http://www.starnet.com/products/xwin32/"
                   2307:                     target="_top">StarNet X-Win32</a>, <a href=
                   2308:                     "http://connectivity.hummingbird.com/products/nc/exceed/"
                   2309:                     target="_top">Hummingbird Exceed</a>, and the
                   2310:                     free X-Windows server included with <a href=
                   2311:                     "http://x.cygwin.com/" target=
                   2312:                     "_top">Cygwin</a>.</p>
                   2313: 
                   2314:                     <p>Also, StarNet Communications has graciously
                   2315:                     provided a free version of their X-Win32
                   2316:                     product that accepts connections only from
                   2317:                     localhost: <a href=
                   2318:                     "http://www.starnet.com/xwin32LX/get_xwin32LX.htm"
                   2319:                     target="_top">X-Win32 LX</a>, recommended by
                   2320:                     the maintainer of Interix pkgsrc support.</p>
                   2321:                   </li>
                   2322: 
                   2323:                   <li>
                   2324:                     <span class="strong"><strong>X-Windows
                   2325:                     acceleration:</strong></span>
                   2326: 
                   2327:                     <p>Because Interix runs in a completely
                   2328:                     different NT subsystem from Win32 applications,
                   2329:                     it does not currently support various X11
                   2330:                     protocol extensions for acceleration (such as
                   2331:                     MIT-SHM or DGA). Most interactive applications
                   2332:                     to a local X server will run reasonably fast,
                   2333:                     but full motion video and other graphics
                   2334:                     intensive applications may require a
                   2335:                     faster-than-expected CPU.</p>
                   2336:                   </li>
                   2337: 
                   2338:                   <li>
                   2339:                     <span class=
                   2340:                     "strong"><strong>Audio:</strong></span>
                   2341: 
                   2342:                     <p>Interix has no native support for audio
1.53    ! tv       2343:                     output. For audio support, pkgsrc uses the
        !          2344:                     <span><strong class=
1.52      tv       2345:                     "command">esound</strong></span> client/server
                   2346:                     audio system on Interix. Unlike on most
                   2347:                     platforms, the <a xmlns=
                   2348:                     "http://www.w3.org/TR/xhtml1/transitional"
                   2349:                     href="ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/audio/esound/README.html"
                   2350:                     target="_top"><code xmlns="" class=
                   2351:                     "filename">audio/esound</code></a> package does
                   2352:                     <span class="emphasis"><em>not</em></span>
                   2353:                     contain the <span><strong class=
1.53    ! tv       2354:                     "command">esd</strong></span> server component.
        !          2355:                     To output audio via an Interix host, the
        !          2356:                     <a xmlns=
1.52      tv       2357:                     "http://www.w3.org/TR/xhtml1/transitional"
                   2358:                     href="ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/emulators/cygwin_esound/README.html"
                   2359:                     target="_top"><code xmlns="" class=
                   2360:                     "filename">emulators/cygwin_esound</code></a>
                   2361:                     package must also be installed.</p>
                   2362:                   </li>
                   2363: 
                   2364:                   <li>
                   2365:                     <span class="strong"><strong>CD/DVDs, USB, and
                   2366:                     SCSI:</strong></span>
                   2367: 
                   2368:                     <p>Direct device access is not currently
                   2369:                     supported in Interix, so it is not currently
                   2370:                     possible to access CD/DVD drives, USB devices,
                   2371:                     or SCSI devices through non-filesystem means.
                   2372:                     Among other things, this makes it impossible to
                   2373:                     use Interix directly for CD/DVD burning.</p>
                   2374:                   </li>
                   2375: 
                   2376:                   <li>
                   2377:                     <span class="strong"><strong>Tape
                   2378:                     drives:</strong></span>
                   2379: 
                   2380:                     <p>Due to the same limitations as for CD-ROMs
                   2381:                     and SCSI devices, tape drives are also not
                   2382:                     directly accessible in Interix. However,
                   2383:                     support is in work to make tape drive access
                   2384:                     possible by using Cygwin as a bridge (similarly
                   2385:                     to audio bridged via Cygwin's esound
                   2386:                     server).</p>
                   2387:                   </li>
                   2388:                 </ul>
                   2389:               </div>
                   2390:             </div>
                   2391: 
                   2392:             <div class="sect3" lang="en">
                   2393:               <div class="titlepage">
                   2394:                 <div>
                   2395:                   <div>
                   2396:                     <h4 class="title"><a name=
                   2397:                     "platform.interix-knownissues"></a>3.2.3.5.&nbsp;Known
                   2398:                     issues for pkgsrc on Interix</h4>
                   2399:                   </div>
                   2400:                 </div>
                   2401:               </div>
                   2402: 
                   2403:               <p>It is not necessary, in general, to have a "root"
                   2404:               user on the Windows system; any member of the local
                   2405:               Administrators group will suffice. However, some
                   2406:               packages currently assume that the user named "root"
                   2407:               is the privileged user. To accommodate these, you may
                   2408:               create such a user; make sure it is in the local
                   2409:               group Administrators (or your language
                   2410:               equivalent).</p>
                   2411: 
                   2412:               <p>"pkg_add" creates directories of mode 0755, not
                   2413:               0775, in $PKG_DBDIR. For the time being, install
                   2414:               packages as the local Administrator (or your language
                   2415:               equivalent), or run the following command after
                   2416:               installing a package to work around the issue:</p>
                   2417:               <pre class="screen">
                   2418: <code class="prompt">#</code> <strong class=
                   2419: "userinput"><code>chmod -R g+w $PKG_DBDIR</code></strong>
                   2420: </pre>
                   2421:             </div>
1.1       grant    2422:           </div>
                   2423: 
1.52      tv       2424:           <div class="sect2" lang="en">
1.1       grant    2425:             <div class="titlepage">
                   2426:               <div>
                   2427:                 <div>
1.52      tv       2428:                   <h3 class="title"><a name=
1.30      wiz      2429:                   "irix"></a>3.2.4.&nbsp;IRIX</h3>
1.1       grant    2430:                 </div>
                   2431:               </div>
                   2432:             </div>
                   2433: 
                   2434:             <p>You will need a working C compiler, either gcc or
                   2435:             SGI's MIPS and MIPSpro compiler (cc/c89). Please set
1.14      xtraeme  2436:             the <code class="varname">CC</code> environment
                   2437:             variable according to your preference. If you do not
                   2438:             have a license for the MIPSpro compiler suite, you can
1.1       grant    2439:             download a gcc tardist file from <a href=
                   2440:             "http://freeware.sgi.com/" target=
                   2441:             "_top">http://freeware.sgi.com/</a>.</p>
                   2442: 
                   2443:             <p>Please note that you will need IRIX 6.5.17 or
                   2444:             higher, as this is the earliest version of IRIX
1.24      wiz      2445:             providing support for <a href=
                   2446:             "http://netbsd.gw.com/cgi-bin/man-cgi?if_indextoname+3+NetBSD-current">
                   2447:             <span class="citerefentry"><span class=
                   2448:             "refentrytitle">if_indextoname</span>(3)</span></a>,
                   2449:             <a href=
                   2450:             "http://netbsd.gw.com/cgi-bin/man-cgi?if_nametoindex+3+NetBSD-current">
                   2451:             <span class="citerefentry"><span class=
                   2452:             "refentrytitle">if_nametoindex</span>(3)</span></a>,
                   2453:             etc.</p>
1.1       grant    2454: 
1.27      rillig   2455:             <p>At this point in time, pkgsrc only supports one ABI
                   2456:             at a time. That is, you can not switch between the old
                   2457:             32-bit ABI, the new 32-bit ABI and the 64-bit ABI. If
                   2458:             you start out using "abi=n32", that's what all your
                   2459:             packages will be built with.</p>
1.1       grant    2460: 
                   2461:             <p>Therefore, please make sure that you have no
1.14      xtraeme  2462:             conflicting <code class="varname">CFLAGS</code> in your
1.45      wiz      2463:             environment or the <code xmlns=
                   2464:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2465:             "filename">/etc/mk.conf</code>. Particularly, make sure
1.1       grant    2466:             that you do not try to link n32 object files with lib64
1.45      wiz      2467:             or vice versa. Check your <code xmlns=
                   2468:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2469:             "filename">/etc/compiler.defaults</code>!</p>
1.1       grant    2470: 
                   2471:             <p>If you have the actual pkgsrc tree mounted via NFS
                   2472:             from a different host, please make sure to set
1.14      xtraeme  2473:             <code class="varname">WRKOBJDIR</code> to a local
1.1       grant    2474:             directory, as it appears that IRIX linker occasionally
1.47      reed     2475:             runs into issues when trying to link over a
                   2476:             network-mounted file system.</p>
1.1       grant    2477: 
                   2478:             <p>The bootstrapping process should set all the right
                   2479:             options for programs such as imake(1), but you may want
                   2480:             to set some options depending on your local setup.
1.45      wiz      2481:             Please see <code xmlns=
                   2482:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2483:             "filename">pkgsrc/mk/defaults/mk.conf</code> and, of
1.27      rillig   2484:             course, your compiler's man pages for details.</p>
1.22      tv       2485: 
                   2486:             <p>If you are using SGI's MIPSPro compiler, please
                   2487:             set</p>
                   2488:             <pre class="programlisting">
1.51      rillig   2489:     PKGSRC_COMPILER=        mipspro
1.22      tv       2490: </pre>
                   2491: 
1.45      wiz      2492:             <p>in <code xmlns=
                   2493:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   2494:             "filename">/etc/mk.conf</code>. Otherwise, pkgsrc will
                   2495:             assume you are using gcc and may end up passing invalid
                   2496:             flags to the compiler. Note that bootstrap should
                   2497:             create an appropriate <code xmlns=
                   2498:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.22      tv       2499:             "filename">mk.conf.example</code> by default.</p>
                   2500: 
                   2501:             <p>If you have both the MIPSPro compiler chain
                   2502:             installed as well as gcc, but want to make sure that
                   2503:             MIPRPro is used, please set your <code class=
                   2504:             "varname">PATH</code> to <span class=
                   2505:             "emphasis"><em>not</em></span> include the location of
1.45      wiz      2506:             gcc (often <code xmlns=
                   2507:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.22      tv       2508:             "filename">/usr/freeware/bin</code>), and (important)
                   2509:             pass the '--preserve-path' flag.</p>
1.1       grant    2510:           </div>
                   2511: 
1.52      tv       2512:           <div class="sect2" lang="en">
1.1       grant    2513:             <div class="titlepage">
                   2514:               <div>
                   2515:                 <div>
1.52      tv       2516:                   <h3 class="title"><a name=
1.30      wiz      2517:                   "linux"></a>3.2.5.&nbsp;Linux</h3>
1.22      tv       2518:                 </div>
                   2519:               </div>
                   2520:             </div>
                   2521: 
                   2522:             <p>Some versions of Linux (for example Debian
                   2523:             GNU/Linux) need either libtermcap or libcurses
                   2524:             (libncurses). Installing the distributions
                   2525:             libncurses-dev package (or equivalent) should fix the
                   2526:             problem.</p>
                   2527: 
                   2528:             <p>pkgsrc supports both gcc (GNU Compiler Collection)
                   2529:             and icc (Intel C++ Compiler). gcc is the default. icc
                   2530:             8.0 and 8.1 on i386 have been tested.</p>
                   2531: 
                   2532:             <p>To bootstrap using icc, assuming the default icc
                   2533:             installation directory:</p>
                   2534:             <pre class="programlisting">
1.51      rillig   2535:     env CC=/opt/intel_cc_80/bin/icc LDFLAGS=-static-libcxa \
                   2536:             ac_cv___attribute__=yes ./bootstrap
1.22      tv       2537: </pre>
                   2538: 
                   2539:             <div class="note" style=
                   2540:             "margin-left: 0.5in; margin-right: 0.5in;">
                   2541:               <h3 class="title">Note</h3>
                   2542: 
                   2543:               <p>icc 8.1 needs the `-i-static' argument instead of
                   2544:               -static-libcxa.</p>
                   2545:             </div>
                   2546: 
                   2547:             <p>icc supports __attribute__, but the GNU configure
                   2548:             test uses a nested function, which icc does not
                   2549:             support. #undef'ing __attribute__ has the unfortunate
                   2550:             side-effect of breaking many of the Linux header files,
                   2551:             which cannot be compiled properly without
                   2552:             __attribute__. The test must be overridden so that
                   2553:             __attribute__ is assumed supported by the compiler.</p>
                   2554: 
                   2555:             <p>After bootstrapping, you should set <code class=
1.45      wiz      2556:             "varname">PKGSRC_COMPILER</code> in <code xmlns=
                   2557:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.22      tv       2558:             "filename">/etc/mk.conf</code>:</p>
                   2559:             <pre class="programlisting">
1.51      rillig   2560:     PKGSRC_COMPILER=        icc
1.22      tv       2561: </pre>
                   2562: 
                   2563:             <p>The default installation directory for icc is
1.45      wiz      2564:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   2565:             class="filename">/opt/intel_cc_80</code>, which is also
                   2566:             the pkgsrc default. If you have installed it into a
                   2567:             different directory, set <code class=
                   2568:             "varname">ICCBASE</code> in <code xmlns=
                   2569:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.22      tv       2570:             "filename">/etc/mk.conf</code>:</p>
                   2571:             <pre class="programlisting">
1.51      rillig   2572:     ICCBASE=                /opt/icc
1.22      tv       2573: </pre>
                   2574: 
                   2575:             <p>pkgsrc uses the static linking method of the runtime
                   2576:             libraries provided by icc, so binaries can be run on
                   2577:             other systems which do not have the shared libraries
                   2578:             installed.</p>
                   2579: 
                   2580:             <p>Libtool, however, extracts a list of libraries from
1.24      wiz      2581:             the <a href=
                   2582:             "http://netbsd.gw.com/cgi-bin/man-cgi?ld+1+NetBSD-current">
                   2583:             <span class="citerefentry"><span class=
                   2584:             "refentrytitle">ld</span>(1)</span></a> command run
                   2585:             when linking a C++ shared library and records it,
                   2586:             throwing away the -Bstatic and -Bdynamic options
                   2587:             interspersed between the libraries. This means that
                   2588:             libtool-linked C++ shared libraries will have a runtime
                   2589:             dependency on the icc libraries until this is fixed in
                   2590:             libtool.</p>
1.22      tv       2591:           </div>
                   2592: 
1.52      tv       2593:           <div class="sect2" lang="en">
1.22      tv       2594:             <div class="titlepage">
                   2595:               <div>
                   2596:                 <div>
1.52      tv       2597:                   <h3 class="title"><a name=
1.30      wiz      2598:                   "openbsd"></a>3.2.6.&nbsp;OpenBSD</h3>
1.1       grant    2599:                 </div>
                   2600:               </div>
                   2601:             </div>
                   2602: 
                   2603:             <p>OpenBSD 3.0 and 3.2 are tested and supported.</p>
                   2604: 
                   2605:             <p>Care should be taken so that the tools that this kit
                   2606:             installs do not conflict with the OpenBSD userland
                   2607:             tools. There are several steps:</p>
                   2608: 
                   2609:             <div class="orderedlist">
                   2610:               <ol type="1">
                   2611:                 <li>
                   2612:                   <p>OpenBSD stores its ports pkg database in
1.45      wiz      2613:                   <code xmlns=
                   2614:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   2615:                   "filename">/var/db/pkg</code>. It is therefore
                   2616:                   recommended that you choose a different location
                   2617:                   (e.g. <code xmlns=
                   2618:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2619:                   "filename">/usr/pkgdb</code>) by using the
1.1       grant    2620:                   --pkgdbdir option to the bootstrap script.</p>
                   2621:                 </li>
                   2622: 
                   2623:                 <li>
                   2624:                   <p>If you do not intend to use the OpenBSD ports
                   2625:                   tools, it's probably a good idea to move them out
                   2626:                   of the way to avoid confusion, e.g.</p>
                   2627:                   <pre class="screen">
1.14      xtraeme  2628: <code class="prompt">#</code> <strong class=
                   2629: "userinput"><code>cd /usr/sbin</code></strong>
                   2630: <code class="prompt">#</code> <strong class=
                   2631: "userinput"><code>mv pkg_add pkg_add.orig</code></strong>
                   2632: <code class="prompt">#</code> <strong class=
                   2633: "userinput"><code>mv pkg_create pkg_create.orig</code></strong>
                   2634: <code class="prompt">#</code> <strong class=
                   2635: "userinput"><code>mv pkg_delete pkg_delete.orig</code></strong>
                   2636: <code class="prompt">#</code> <strong class=
                   2637: "userinput"><code>mv pkg_info pkg_info.orig</code></strong>
1.1       grant    2638: </pre>
                   2639:                 </li>
                   2640: 
                   2641:                 <li>
1.45      wiz      2642:                   <p>An example <code xmlns=
                   2643:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2644:                   "filename">/etc/mk.conf</code> file will be
1.45      wiz      2645:                   placed in <code xmlns=
                   2646:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2647:                   "filename">/etc/mk.conf.example</code> file when
                   2648:                   you use the bootstrap script. OpenBSD's make
1.45      wiz      2649:                   program uses <code xmlns=
                   2650:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2651:                   "filename">/etc/mk.conf</code> as well. You can
1.47      reed     2652:                   work around this by enclosing all the
                   2653:                   pkgsrc-specific parts of the file with:</p>
1.1       grant    2654:                   <pre class="programlisting">
1.51      rillig   2655:     .ifdef BSD_PKG_MK
                   2656:     # pkgsrc stuff, e.g. insert defaults/mk.conf or similar here
                   2657:     .else
                   2658:     # OpenBSD stuff
                   2659:     .endif
1.1       grant    2660: </pre>
                   2661:                 </li>
                   2662:               </ol>
                   2663:             </div>
                   2664:           </div>
                   2665: 
1.52      tv       2666:           <div class="sect2" lang="en">
1.1       grant    2667:             <div class="titlepage">
                   2668:               <div>
                   2669:                 <div>
1.52      tv       2670:                   <h3 class="title"><a name=
1.30      wiz      2671:                   "solaris"></a>3.2.7.&nbsp;Solaris</h3>
1.1       grant    2672:                 </div>
                   2673:               </div>
                   2674:             </div>
                   2675: 
                   2676:             <p>Solaris 2.6 through 9 are supported on both x86 and
                   2677:             sparc. You will need a working C compiler. Both gcc
                   2678:             2.95.3 and Sun WorkShop 5 have been tested.</p>
                   2679: 
                   2680:             <p>The following packages are required on Solaris 8 for
                   2681:             the bootstrap process and to build packages.</p>
                   2682: 
                   2683:             <div class="itemizedlist">
                   2684:               <ul type="disc">
                   2685:                 <li>
                   2686:                   <p>SUNWsprot</p>
                   2687:                 </li>
                   2688: 
                   2689:                 <li>
                   2690:                   <p>SUNWarc</p>
                   2691:                 </li>
                   2692: 
                   2693:                 <li>
                   2694:                   <p>SUNWbtool</p>
                   2695:                 </li>
                   2696: 
                   2697:                 <li>
                   2698:                   <p>SUNWtoo</p>
                   2699:                 </li>
                   2700: 
                   2701:                 <li>
                   2702:                   <p>SUNWlibm</p>
                   2703:                 </li>
                   2704:               </ul>
                   2705:             </div>
                   2706: 
                   2707:             <p>Please note the use of GNU binutils on Solaris is
                   2708:             <span class="emphasis"><em>not</em></span>
                   2709:             supported.</p>
                   2710: 
1.52      tv       2711:             <div class="sect3" lang="en">
1.1       grant    2712:               <div class="titlepage">
                   2713:                 <div>
                   2714:                   <div>
1.52      tv       2715:                     <h4 class="title"><a name=
                   2716:                     "solaris-gcc-note"></a>3.2.7.1.&nbsp;If you are
                   2717:                     using gcc</h4>
1.1       grant    2718:                   </div>
                   2719:                 </div>
                   2720:               </div>
                   2721: 
                   2722:               <p>It makes life much simpler if you only use the
                   2723:               same gcc consistently for building all packages.</p>
                   2724: 
                   2725:               <p>It is recommended that an external gcc be used
                   2726:               only for bootstrapping, then either build gcc from
                   2727:               <a xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   2728:               href=
                   2729:               "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/lang/gcc/README.html"
1.45      wiz      2730:               target="_top"><code xmlns="" class=
                   2731:               "filename">lang/gcc</code></a> or install a binary
                   2732:               gcc package, then remove gcc used during
1.20      ben      2733:               bootstrapping.</p>
1.1       grant    2734: 
                   2735:               <p>Binary packages of gcc can be found through
                   2736:               <a href=
                   2737:               "http://www.sun.com/bigadmin/common/freewareSearch.html"
1.20      ben      2738:               target=
                   2739:               "_top">http://www.sun.com/bigadmin/common/freewareSearch.html</a>.</p>
1.1       grant    2740:             </div>
                   2741: 
1.52      tv       2742:             <div class="sect3" lang="en">
1.1       grant    2743:               <div class="titlepage">
                   2744:                 <div>
                   2745:                   <div>
1.30      wiz      2746:                     <h4 class="title"><a name=
                   2747:                     "solaris-sun-workshop-note"></a>3.2.7.2.&nbsp;If
                   2748:                     you are using Sun WorkShop</h4>
1.1       grant    2749:                   </div>
                   2750:                 </div>
                   2751:               </div>
                   2752: 
                   2753:               <p>You will need at least the following packages
                   2754:               installed (from WorkShop 5.0)</p>
                   2755: 
                   2756:               <div class="itemizedlist">
                   2757:                 <ul type="disc">
                   2758:                   <li>
                   2759:                     <p>SPROcc - Sun WorkShop Compiler C 5.0</p>
                   2760:                   </li>
                   2761: 
                   2762:                   <li>
                   2763:                     <p>SPROcpl - Sun WorkShop Compiler C++ 5.0</p>
                   2764:                   </li>
                   2765: 
                   2766:                   <li>
                   2767:                     <p>SPROild - Sun WorkShop Incremental
                   2768:                     Linker</p>
                   2769:                   </li>
                   2770: 
                   2771:                   <li>
                   2772:                     <p>SPROlang - Sun WorkShop Compilers common
                   2773:                     components</p>
                   2774:                   </li>
                   2775:                 </ul>
                   2776:               </div>
                   2777: 
1.14      xtraeme  2778:               <p>You should set <code class="varname">CC</code>,
                   2779:               <code class="varname">CXX</code> and optionally,
1.45      wiz      2780:               <code class="varname">CPP</code> in <code xmlns=
                   2781:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.47      reed     2782:               "filename">/etc/mk.conf</code>, e.g.:</p>
1.1       grant    2783:               <pre class="programlisting">
1.51      rillig   2784:     CC=     cc
                   2785:     CXX=    CC
                   2786:     CPP=    /usr/ccs/lib/cpp
1.1       grant    2787: </pre>
                   2788: 
                   2789:               <p>You may also want to build 64-bit binaries,
1.47      reed     2790:               e.g.:</p>
1.1       grant    2791:               <pre class="programlisting">
1.51      rillig   2792:     CFLAGS= -xtarget=ultra -xarch=v9
1.1       grant    2793: </pre>
                   2794: 
                   2795:               <p>Whichever compiler you use, please ensure the
                   2796:               compiler tools and your $prefix are in your
1.14      xtraeme  2797:               <code class="varname">PATH</code>. This includes
1.45      wiz      2798:               <code xmlns=
                   2799:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.47      reed     2800:               "filename">/usr/ccs/{bin,lib}</code> and e.g.
1.45      wiz      2801:               <code xmlns=
                   2802:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2803:               "filename">/usr/pkg/{bin,sbin}</code>.</p>
1.1       grant    2804:             </div>
                   2805:           </div>
                   2806:         </div>
                   2807:       </div>
                   2808: 
1.52      tv       2809:       <div class="chapter" lang="en">
1.1       grant    2810:         <div class="titlepage">
                   2811:           <div>
                   2812:             <div>
1.52      tv       2813:               <h2 class="title"><a name=
1.1       grant    2814:               "using"></a>Chapter&nbsp;4.&nbsp;Using pkgsrc</h2>
                   2815:             </div>
                   2816:           </div>
                   2817:         </div>
                   2818: 
                   2819:         <div class="toc">
                   2820:           <p><b>Table of Contents</b></p>
                   2821: 
                   2822:           <dl>
                   2823:             <dt><span class="sect1"><a href="#getting-started">4.1.
                   2824:             Working with binary packages</a></span></dt>
                   2825: 
                   2826:             <dd>
                   2827:               <dl>
1.30      wiz      2828:                 <dt><span class="sect2"><a href=
                   2829:                 "#where-to-get-binary-packages">4.1.1. Where to get
                   2830:                 binary packages</a></span></dt>
1.1       grant    2831: 
1.30      wiz      2832:                 <dt><span class="sect2"><a href=
                   2833:                 "#how-to-use-binary-packages">4.1.2. How to use
                   2834:                 binary packages</a></span></dt>
1.1       grant    2835: 
1.30      wiz      2836:                 <dt><span class="sect2"><a href=
                   2837:                 "#a-word-of-warning">4.1.3. A word of
                   2838:                 warning</a></span></dt>
1.1       grant    2839:               </dl>
                   2840:             </dd>
                   2841: 
1.30      wiz      2842:             <dt><span class="sect1"><a href=
                   2843:             "#building-packages-from-source">4.2. Building packages
                   2844:             from source</a></span></dt>
1.1       grant    2845: 
                   2846:             <dd>
                   2847:               <dl>
1.30      wiz      2848:                 <dt><span class="sect2"><a href=
                   2849:                 "#requirements">4.2.1. Requirements</a></span></dt>
1.1       grant    2850: 
1.30      wiz      2851:                 <dt><span class="sect2"><a href=
                   2852:                 "#fetching-distfiles">4.2.2. Fetching
                   2853:                 distfiles</a></span></dt>
1.1       grant    2854: 
1.30      wiz      2855:                 <dt><span class="sect2"><a href=
                   2856:                 "#how-to-build-and-install">4.2.3. How to build and
                   2857:                 install</a></span></dt>
1.1       grant    2858: 
1.30      wiz      2859:                 <dt><span class="sect2"><a href=
                   2860:                 "#selecting-the-compiler">4.2.4. Selecting the
                   2861:                 compiler</a></span></dt>
1.1       grant    2862:               </dl>
                   2863:             </dd>
                   2864:           </dl>
                   2865:         </div>
                   2866: 
1.52      tv       2867:         <div class="sect1" lang="en">
1.1       grant    2868:           <div class="titlepage">
                   2869:             <div>
                   2870:               <div>
                   2871:                 <h2 class="title" style="clear: both"><a name=
                   2872:                 "getting-started"></a>4.1.&nbsp;Working with binary
                   2873:                 packages</h2>
                   2874:               </div>
                   2875:             </div>
                   2876:           </div>
                   2877: 
                   2878:           <p>This section describes how to find, retrieve and
                   2879:           install a precompiled binary package that someone else
                   2880:           already prepared for your type of machine.</p>
                   2881: 
1.52      tv       2882:           <div class="sect2" lang="en">
1.1       grant    2883:             <div class="titlepage">
                   2884:               <div>
                   2885:                 <div>
1.30      wiz      2886:                   <h3 class="title"><a name=
                   2887:                   "where-to-get-binary-packages"></a>4.1.1.&nbsp;Where
                   2888:                   to get binary packages</h3>
1.1       grant    2889:                 </div>
                   2890:               </div>
                   2891:             </div>
                   2892: 
                   2893:             <p>Precompiled packages are stored on ftp.NetBSD.org
1.45      wiz      2894:             and its mirrors in the directory <code xmlns=
                   2895:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   2896:             "filename">/pub/NetBSD/packages/&lt;OSVERSION&gt;/&lt;ARCH&gt;/</code>
                   2897:             for anonymous FTP access. <code class=
                   2898:             "varname">OSVERSION</code> is the NetBSD version
                   2899:             (<span><strong class="command">uname
                   2900:             -r</strong></span>), <code class="varname">ARCH</code>
                   2901:             is the architecture (<span><strong class=
                   2902:             "command">uname -p</strong></span>). In that directory,
                   2903:             there is a subdirectory for each category plus a
1.45      wiz      2904:             subdirectory <code xmlns=
                   2905:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   2906:             "filename">All</code> which includes the actual
                   2907:             binaries in <code xmlns=
                   2908:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   2909:             "filename">.tgz</code> files. The category
                   2910:             subdirectories use symbolic links to those files (this
1.45      wiz      2911:             is the same directory layout as in <code xmlns=
                   2912:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  2913:             "filename">/usr/pkgsrc/packages</code>).</p>
1.1       grant    2914: 
1.47      reed     2915:             <p>This same directory layout applies for CD-ROM
1.1       grant    2916:             distributions, only that the directory may be rooted
1.45      wiz      2917:             somewhere else, probably somewhere below <code xmlns=
                   2918:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.47      reed     2919:             "filename">/cdrom</code>. Please consult your CD-ROMs
1.1       grant    2920:             documentation for the exact location.</p>
                   2921:           </div>
                   2922: 
1.52      tv       2923:           <div class="sect2" lang="en">
1.1       grant    2924:             <div class="titlepage">
                   2925:               <div>
                   2926:                 <div>
1.30      wiz      2927:                   <h3 class="title"><a name=
                   2928:                   "how-to-use-binary-packages"></a>4.1.2.&nbsp;How
                   2929:                   to use binary packages</h3>
1.1       grant    2930:                 </div>
                   2931:               </div>
                   2932:             </div>
                   2933: 
1.47      reed     2934:             <p>If you have the files on a CD-ROM or downloaded them
1.23      wiz      2935:             to your hard disk, you can install them with the
1.27      rillig   2936:             following command (be sure to <span><strong class=
1.14      xtraeme  2937:             "command">su</strong></span> to root first):</p>
1.1       grant    2938:             <pre class="screen">
1.14      xtraeme  2939: <code class="prompt">#</code> <strong class=
                   2940: "userinput"><code>pkg_add /path/to/package.tgz</code></strong>
1.1       grant    2941: </pre>
                   2942: 
                   2943:             <p>If you have FTP access and you don't want to
                   2944:             download the packages via FTP prior to installation,
1.14      xtraeme  2945:             you can do this automatically by giving
                   2946:             <span><strong class="command">pkg_add</strong></span>
                   2947:             an FTP URL:</p>
1.1       grant    2948:             <pre class="screen">
1.14      xtraeme  2949: <code class="prompt">#</code> <strong class=
1.27      rillig   2950: "userinput"><code>pkg_add ftp://ftp.NetBSD.org/pub/NetBSD/packages/&lt;OSVERSION&gt;/&lt;ARCH&gt;/All/package.tgz</code></strong>
1.1       grant    2951: </pre>
                   2952: 
1.27      rillig   2953:             <p>Note that any prerequisite packages needed to run
                   2954:             the package in question will be installed, too,
1.1       grant    2955:             assuming they are present where you install from.</p>
                   2956: 
1.23      wiz      2957:             <p>To save some typing, you can set the <code class=
                   2958:             "varname">PKG_PATH</code> environment variable to a
1.47      reed     2959:             semicolon-separated list of paths (including remote
1.23      wiz      2960:             URLs); trailing slashes are not allowed.</p>
                   2961: 
1.45      wiz      2962:             <p>Additionally to the <code xmlns=
                   2963:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.23      wiz      2964:             "filename">All</code> directory there exists a
1.45      wiz      2965:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   2966:             class="filename">vulnerable</code> directory to which
                   2967:             binary packages with known vulnerabilities are moved,
                   2968:             since removing them could cause missing dependencies.
                   2969:             To use these packages, add the <code xmlns=
                   2970:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   2971:             "filename">vulnerable</code> directory to your
                   2972:             <code class="varname">PKG_PATH</code>. However, you
                   2973:             should run <a xmlns=
1.23      wiz      2974:             "http://www.w3.org/TR/xhtml1/transitional" href=
                   2975:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/audit-packages/README.html"
1.45      wiz      2976:             target="_top"><code xmlns="" class=
                   2977:             "filename">security/audit-packages</code></a>
1.47      reed     2978:             regularly, especially after installing new packages,
                   2979:             and verify that the vulnerabilities are acceptable for
                   2980:             your configuration. An example <code class=
                   2981:             "varname">PKG_PATH</code> would be: <code xmlns=
                   2982:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   2983:             "filename">ftp://ftp.NetBSD.org/pub/NetBSD/packages/&lt;OSVERSION&gt;/&lt;ARCH&gt;/All;ftp://ftp.NetBSD.org/pub/NetBSD/packages/&lt;OSVERSION&gt;/&lt;ARCH&gt;/vulnerable</code>
1.23      wiz      2984:             Please note that semicolon (';') is a shell
                   2985:             meta-character, so you'll probably have to quote
                   2986:             it.</p>
                   2987: 
1.1       grant    2988:             <p>After you've installed packages, be sure to have
1.45      wiz      2989:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   2990:             class="filename">/usr/pkg/bin</code> and <code xmlns=
                   2991:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   2992:             "filename">/usr/pkg/sbin</code> in your <code class=
                   2993:             "varname">PATH</code> so you can actually start the
                   2994:             just installed program.</p>
1.1       grant    2995:           </div>
                   2996: 
1.52      tv       2997:           <div class="sect2" lang="en">
1.1       grant    2998:             <div class="titlepage">
                   2999:               <div>
                   3000:                 <div>
1.52      tv       3001:                   <h3 class="title"><a name=
1.30      wiz      3002:                   "a-word-of-warning"></a>4.1.3.&nbsp;A word of
1.1       grant    3003:                   warning</h3>
                   3004:                 </div>
                   3005:               </div>
                   3006:             </div>
                   3007: 
                   3008:             <p>Please pay very careful attention to the warnings
                   3009:             expressed in the <a href=
                   3010:             "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current">
                   3011:             <span class="citerefentry"><span class=
                   3012:             "refentrytitle">pkg_add</span>(1)</span></a> manual
                   3013:             page about the inherent dangers of installing binary
                   3014:             packages which you did not create yourself, and the
                   3015:             security holes that can be introduced onto your system
                   3016:             by indiscriminate adding of such files.</p>
                   3017:           </div>
                   3018:         </div>
                   3019: 
1.52      tv       3020:         <div class="sect1" lang="en">
1.1       grant    3021:           <div class="titlepage">
                   3022:             <div>
                   3023:               <div>
                   3024:                 <h2 class="title" style="clear: both"><a name=
1.30      wiz      3025:                 "building-packages-from-source"></a>4.2.&nbsp;Building
1.1       grant    3026:                 packages from source</h2>
                   3027:               </div>
                   3028:             </div>
                   3029:           </div>
                   3030: 
                   3031:           <p>This assumes that the package is already in pkgsrc. If
                   3032:           it is not, see <a href="#developers-guide" title=
1.46      gdt      3033:           "Part&nbsp;II.&nbsp;The pkgsrc developer's guide">Part&nbsp;II,
1.27      rillig   3034:           &#8220;The pkgsrc developer's guide&#8221;</a> for
                   3035:           instructions how to create your own packages.</p>
1.1       grant    3036: 
1.52      tv       3037:           <div class="sect2" lang="en">
1.1       grant    3038:             <div class="titlepage">
                   3039:               <div>
                   3040:                 <div>
1.52      tv       3041:                   <h3 class="title"><a name=
1.30      wiz      3042:                   "requirements"></a>4.2.1.&nbsp;Requirements</h3>
1.1       grant    3043:                 </div>
                   3044:               </div>
                   3045:             </div>
                   3046: 
                   3047:             <p>To build packages from source on a NetBSD system the
                   3048:             &#8220;<span class="quote">comp</span>&#8221; and the
                   3049:             &#8220;<span class="quote">text</span>&#8221;
                   3050:             distribution sets must be installed. If you want to
1.47      reed     3051:             build X11-related packages the &#8220;<span class=
1.1       grant    3052:             "quote">xbase</span>&#8221; and &#8220;<span class=
                   3053:             "quote">xcomp</span>&#8221; distribution sets are
                   3054:             required, too.</p>
                   3055:           </div>
                   3056: 
1.52      tv       3057:           <div class="sect2" lang="en">
1.1       grant    3058:             <div class="titlepage">
                   3059:               <div>
                   3060:                 <div>
1.52      tv       3061:                   <h3 class="title"><a name=
                   3062:                   "fetching-distfiles"></a>4.2.2.&nbsp;Fetching
1.1       grant    3063:                   distfiles</h3>
                   3064:                 </div>
                   3065:               </div>
                   3066:             </div>
                   3067: 
1.27      rillig   3068:             <p>The first step for building a package is downloading
                   3069:             the distfiles (i.e. the unmodified source). If they
                   3070:             have not yet been downloaded, pkgsrc will fetch them
1.1       grant    3071:             automatically.</p>
                   3072: 
                   3073:             <p>You can overwrite some of the major distribution
                   3074:             sites to fit to sites that are close to your own. Have
1.45      wiz      3075:             a look at <code xmlns=
                   3076:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3077:             "filename">pkgsrc/mk/defaults/mk.conf</code> to find
1.27      rillig   3078:             some examples &#8212; in particular, look for the
1.14      xtraeme  3079:             <code class="varname">MASTER_SORT</code>, <code class=
                   3080:             "varname">MASTER_SORT_REGEX</code> and <code class=
                   3081:             "varname">INET_COUNTRY</code> definitions. This may
                   3082:             save some of your bandwidth and time.</p>
1.1       grant    3083: 
                   3084:             <p>You can change these settings either in your shell's
                   3085:             environment, or, if you want to keep the settings, by
1.45      wiz      3086:             editing the <code xmlns=
                   3087:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   3088:             "filename">/etc/mk.conf</code> file, and adding the
                   3089:             definitions there.</p>
1.1       grant    3090: 
                   3091:             <p>If you don't have a permanent Internet connection
                   3092:             and you want to know which files to download,
1.14      xtraeme  3093:             <span><strong class="command">make
                   3094:             fetch-list</strong></span> will tell you what you'll
1.45      wiz      3095:             need. Put these distfiles into <code xmlns=
                   3096:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3097:             "filename">/usr/pkgsrc/distfiles</code>.</p>
1.1       grant    3098:           </div>
                   3099: 
1.52      tv       3100:           <div class="sect2" lang="en">
1.1       grant    3101:             <div class="titlepage">
                   3102:               <div>
                   3103:                 <div>
1.30      wiz      3104:                   <h3 class="title"><a name=
                   3105:                   "how-to-build-and-install"></a>4.2.3.&nbsp;How to
                   3106:                   build and install</h3>
1.1       grant    3107:                 </div>
                   3108:               </div>
                   3109:             </div>
                   3110: 
                   3111:             <p>Assuming that the distfile has been fetched (see
                   3112:             previous section), become root and change into the
1.47      reed     3113:             relevant directory and run <span><strong class=
                   3114:             "command">make</strong></span>.</p>
                   3115: 
                   3116:             <div class="note" style=
                   3117:             "margin-left: 0.5in; margin-right: 0.5in;">
                   3118:               <h3 class="title">Note</h3>
                   3119: 
                   3120:               <p>If using bootstrap or pkgsrc on a non-NetBSD
                   3121:               system, use the pkgsrc <span><strong class=
                   3122:               "command">bmake</strong></span> command instead of
                   3123:               &#8220;<span class="quote">make</span>&#8221; in the
                   3124:               examples in this guide.</p>
                   3125:             </div>
                   3126: 
                   3127:             <p>For example, type</p>
1.1       grant    3128:             <pre class="screen">
1.14      xtraeme  3129: <code class="prompt">%</code> <strong class=
                   3130: "userinput"><code>cd misc/figlet</code></strong>
                   3131: <code class="prompt">%</code> <strong class=
                   3132: "userinput"><code>make</code></strong>
1.1       grant    3133: </pre>
                   3134: 
                   3135:             <p>at the shell prompt to build the various components
                   3136:             of the package, and</p>
                   3137:             <pre class="screen">
1.14      xtraeme  3138: <code class="prompt">#</code> <strong class=
                   3139: "userinput"><code>make install</code></strong>
1.1       grant    3140: </pre>
                   3141: 
                   3142:             <p>to install the various components into the correct
                   3143:             places on your system. Installing the package on your
                   3144:             system requires you to be root. However, pkgsrc has a
                   3145:             <span class="emphasis"><em>just-in-time-su</em></span>
                   3146:             feature, which allows you to only become root for the
                   3147:             actual installation step</p>
                   3148: 
                   3149:             <p>Taking the figlet utility as an example, we can
                   3150:             install it on our system by building as shown in
                   3151:             <a href="#logs" title=
1.52      tv       3152:             "Appendix&nbsp;B.&nbsp;Build logs">Appendix&nbsp;B,
                   3153:             <i>Build logs</i></a>.</p>
1.1       grant    3154: 
                   3155:             <p>The program is installed under the default root of
1.45      wiz      3156:             the packages tree - <code xmlns=
                   3157:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3158:             "filename">/usr/pkg</code>. Should this not conform to
                   3159:             your tastes, set the <code class=
                   3160:             "varname">LOCALBASE</code> variable in your
1.1       grant    3161:             environment, and it will use that value as the root of
1.45      wiz      3162:             your packages tree. So, to use <code xmlns=
                   3163:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3164:             "filename">/usr/local</code>, set <code class=
                   3165:             "varname">LOCALBASE=/usr/local</code> in your
1.1       grant    3166:             environment. Please note that you should use a
                   3167:             directory which is dedicated to packages and not shared
1.47      reed     3168:             with other programs (i.e., do not try and use
1.14      xtraeme  3169:             <code class="varname">LOCALBASE=/usr</code>). Also, you
                   3170:             should not try to add any of your own files or
1.45      wiz      3171:             directories (such as <code xmlns=
                   3172:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   3173:             "filename">src/</code>, <code xmlns=
                   3174:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   3175:             "filename">obj/</code>, or <code xmlns=
                   3176:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3177:             "filename">pkgsrc/</code>) below the <code class=
                   3178:             "varname">LOCALBASE</code> tree. This is to prevent
1.1       grant    3179:             possible conflicts between programs and other files
                   3180:             installed by the package system and whatever else may
                   3181:             have been installed there.</p>
                   3182: 
1.45      wiz      3183:             <p>Some packages look in <code xmlns=
                   3184:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3185:             "filename">/etc/mk.conf</code> to alter some
1.1       grant    3186:             configuration options at build time. Have a look at
1.45      wiz      3187:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   3188:             class="filename">pkgsrc/mk/defaults/mk.conf</code> to
                   3189:             get an overview of what will be set there by default.
1.14      xtraeme  3190:             Environment variables such as <code class=
1.45      wiz      3191:             "varname">LOCALBASE</code> can be set in <code xmlns=
                   3192:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3193:             "filename">/etc/mk.conf</code> to save having to
                   3194:             remember to set them each time you want to use
                   3195:             pkgsrc.</p>
1.1       grant    3196: 
                   3197:             <p>Occasionally, people want to &#8220;<span class=
                   3198:             "quote">look under the covers</span>&#8221; to see what
                   3199:             is going on when a package is building or being
                   3200:             installed. This may be for debugging purposes, or out
                   3201:             of simple curiosity. A number of utility values have
                   3202:             been added to help with this.</p>
                   3203: 
                   3204:             <div class="orderedlist">
                   3205:               <ol type="1">
                   3206:                 <li>
                   3207:                   <p>If you invoke the <a href=
                   3208:                   "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current">
                   3209:                   <span class="citerefentry"><span class=
                   3210:                   "refentrytitle">make</span>(1)</span></a> command
1.14      xtraeme  3211:                   with <code class=
                   3212:                   "varname">PKG_DEBUG_LEVEL=2</code>, then a huge
                   3213:                   amount of information will be displayed. For
                   3214:                   example,</p>
1.1       grant    3215:                   <pre class="screen">
1.14      xtraeme  3216: <strong class=
                   3217: "userinput"><code>make patch PKG_DEBUG_LEVEL=2</code></strong>
1.1       grant    3218: </pre>
                   3219: 
                   3220:                   <p>will show all the commands that are invoked,
                   3221:                   up to and including the &#8220;<span class=
                   3222:                   "quote">patch</span>&#8221; stage.</p>
                   3223:                 </li>
                   3224: 
                   3225:                 <li>
                   3226:                   <p>If you want to know the value of a certain
1.22      tv       3227:                   <a href=
                   3228:                   "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current">
                   3229:                   <span class="citerefentry"><span class=
                   3230:                   "refentrytitle">make</span>(1)</span></a>
                   3231:                   definition, then the <code class=
1.14      xtraeme  3232:                   "varname">VARNAME</code> definition should be
                   3233:                   used, in conjunction with the show-var target.
                   3234:                   e.g. to show the expansion of the <a href=
1.1       grant    3235:                   "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current">
                   3236:                   <span class="citerefentry"><span class=
                   3237:                   "refentrytitle">make</span>(1)</span></a>
1.14      xtraeme  3238:                   variable <code class=
1.22      tv       3239:                   "varname">LOCALBASE</code>:</p>
1.1       grant    3240:                   <pre class="screen">
1.14      xtraeme  3241: <code class="prompt">%</code> <strong class=
                   3242: "userinput"><code>make show-var VARNAME=LOCALBASE</code></strong>
1.1       grant    3243: /usr/pkg
1.14      xtraeme  3244: <code class="prompt">%</code>
1.1       grant    3245:           
                   3246: </pre>
                   3247:                 </li>
                   3248:               </ol>
                   3249:             </div>
                   3250: 
                   3251:             <p>If you want to install a binary package that you've
                   3252:             either created yourself (see next section), that you
                   3253:             put into pkgsrc/packages manually or that is located on
1.8       wiz      3254:             a remote FTP server, you can use the "bin-install"
1.1       grant    3255:             target. This target will install a binary package - if
                   3256:             available - via <a href=
                   3257:             "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current">
                   3258:             <span class="citerefentry"><span class=
                   3259:             "refentrytitle">pkg_add</span>(1)</span></a>, else do a
1.14      xtraeme  3260:             <span><strong class="command">make
                   3261:             package</strong></span>. The list of remote FTP sites
                   3262:             searched is kept in the variable <code class=
                   3263:             "varname">BINPKG_SITES</code>, which defaults to
                   3264:             ftp.NetBSD.org. Any flags that should be added to
                   3265:             <a href=
1.1       grant    3266:             "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current">
                   3267:             <span class="citerefentry"><span class=
                   3268:             "refentrytitle">pkg_add</span>(1)</span></a> can be put
1.14      xtraeme  3269:             into <code class="varname">BIN_INSTALL_FLAGS</code>.
1.45      wiz      3270:             See <code xmlns=
                   3271:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3272:             "filename">pkgsrc/mk/defaults/mk.conf</code> for more
                   3273:             details.</p>
1.1       grant    3274: 
1.47      reed     3275:             <p>A final word of warning: If you set up a system that
1.14      xtraeme  3276:             has a non-standard setting for <code class=
                   3277:             "varname">LOCALBASE</code>, be sure to set that before
1.1       grant    3278:             any packages are installed, as you can not use several
                   3279:             directories for the same purpose. Doing so will result
                   3280:             in pkgsrc not being able to properly detect your
                   3281:             installed packages, and fail miserably. Note also that
                   3282:             precompiled binary packages are usually built with the
1.14      xtraeme  3283:             default <code class="varname">LOCALBASE</code> of
1.45      wiz      3284:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   3285:             class="filename">/usr/pkg</code>, and that you should
                   3286:             <span class="emphasis"><em>not</em></span> install any
                   3287:             if you use a non-standard <code class=
1.14      xtraeme  3288:             "varname">LOCALBASE</code>.</p>
1.1       grant    3289:           </div>
                   3290: 
1.52      tv       3291:           <div class="sect2" lang="en">
1.1       grant    3292:             <div class="titlepage">
                   3293:               <div>
                   3294:                 <div>
1.30      wiz      3295:                   <h3 class="title"><a name=
                   3296:                   "selecting-the-compiler"></a>4.2.4.&nbsp;Selecting
                   3297:                   the compiler</h3>
1.1       grant    3298:                 </div>
                   3299:               </div>
                   3300:             </div>
                   3301: 
                   3302:             <p>By default, pkgsrc will use GCC to build packages.
                   3303:             This may be overridden by setting the following
                   3304:             variables in /etc/mk.conf:</p>
                   3305: 
                   3306:             <div class="variablelist">
                   3307:               <dl>
1.14      xtraeme  3308:                 <dt><span class="term"><code class=
                   3309:                 "varname">PKGSRC_COMPILER</code>:</span></dt>
1.1       grant    3310: 
                   3311:                 <dd>
                   3312:                   <p>This is a list of values specifying the chain
                   3313:                   of compilers to invoke when building packages.
                   3314:                   Valid values are:</p>
                   3315: 
                   3316:                   <div class="itemizedlist">
                   3317:                     <ul type="disc">
                   3318:                       <li>
1.14      xtraeme  3319:                         <p><code class="varname">distcc</code>:
1.1       grant    3320:                         distributed C/C++ (chainable)</p>
                   3321:                       </li>
                   3322: 
                   3323:                       <li>
1.14      xtraeme  3324:                         <p><code class="varname">ccache</code>:
1.1       grant    3325:                         compiler cache (chainable)</p>
                   3326:                       </li>
                   3327: 
                   3328:                       <li>
1.14      xtraeme  3329:                         <p><code class="varname">gcc</code>: GNU
                   3330:                         C/C++ Compiler</p>
1.1       grant    3331:                       </li>
                   3332: 
                   3333:                       <li>
1.14      xtraeme  3334:                         <p><code class="varname">mipspro</code>:
1.1       grant    3335:                         Silicon Graphics, Inc. MIPSpro
                   3336:                         (n32/n64)</p>
                   3337:                       </li>
                   3338: 
                   3339:                       <li>
1.14      xtraeme  3340:                         <p><code class="varname">mipspro</code>:
1.1       grant    3341:                         Silicon Graphics, Inc. MIPSpro (o32)</p>
                   3342:                       </li>
                   3343: 
                   3344:                       <li>
1.14      xtraeme  3345:                         <p><code class="varname">sunpro</code>:
1.1       grant    3346:                         Microsystems, Inc. WorkShip/Forte/Sun ONE
                   3347:                         Studio</p>
                   3348:                       </li>
                   3349:                     </ul>
                   3350:                   </div>
                   3351: 
                   3352:                   <p>The default is &#8220;<span class=
1.14      xtraeme  3353:                   "quote"><code class=
                   3354:                   "varname">gcc</code></span>&#8221;. You can use
                   3355:                   <code class="varname">ccache</code> and/or
                   3356:                   <code class="varname">distcc</code> with an
                   3357:                   appropriate <code class=
                   3358:                   "varname">PKGSRC_COMPILER</code> setting, e.g.
                   3359:                   &#8220;<span class="quote"><code class=
                   3360:                   "varname">ccache gcc</code></span>&#8221;. This
1.1       grant    3361:                   variable should always be terminated with a value
                   3362:                   for a real compiler.</p>
                   3363:                 </dd>
                   3364: 
1.14      xtraeme  3365:                 <dt><span class="term"><code class=
                   3366:                 "varname">GCC_REQD</code>:</span></dt>
1.1       grant    3367: 
                   3368:                 <dd>
                   3369:                   <p>This specifies the minimum version of GCC to
                   3370:                   use when building packages. If the system GCC
                   3371:                   doesn't satisfy this requirement, then pkgsrc
                   3372:                   will build and install one of the GCC packages to
                   3373:                   use instead.</p>
                   3374:                 </dd>
                   3375:               </dl>
                   3376:             </div>
                   3377:           </div>
                   3378:         </div>
                   3379:       </div>
                   3380: 
1.52      tv       3381:       <div class="chapter" lang="en">
1.1       grant    3382:         <div class="titlepage">
                   3383:           <div>
                   3384:             <div>
1.52      tv       3385:               <h2 class="title"><a name=
1.38      dillo    3386:               "configuring"></a>Chapter&nbsp;5.&nbsp;Configuring
                   3387:               pkgsrc</h2>
                   3388:             </div>
                   3389:           </div>
                   3390:         </div>
                   3391: 
                   3392:         <div class="toc">
                   3393:           <p><b>Table of Contents</b></p>
                   3394: 
                   3395:           <dl>
                   3396:             <dt><span class="sect1"><a href=
1.45      wiz      3397:             "#general-configuration">5.1. General
                   3398:             configuration</a></span></dt>
                   3399: 
                   3400:             <dt><span class="sect1"><a href=
                   3401:             "#variables-affecting-build">5.2. Variables affecting
                   3402:             the build process</a></span></dt>
                   3403: 
                   3404:             <dt><span class="sect1"><a href=
                   3405:             "#developer-advanced-settings">5.3. Developer/advanced
                   3406:             settings</a></span></dt>
                   3407: 
                   3408:             <dt><span class="sect1"><a href=
                   3409:             "#selecting-build-options">5.4. Selecting Build
1.42      dillo    3410:             Options</a></span></dt>
1.38      dillo    3411:           </dl>
                   3412:         </div>
                   3413: 
1.52      tv       3414:         <div class="sect1" lang="en">
1.38      dillo    3415:           <div class="titlepage">
                   3416:             <div>
                   3417:               <div>
                   3418:                 <h2 class="title" style="clear: both"><a name=
1.45      wiz      3419:                 "general-configuration"></a>5.1.&nbsp;General
                   3420:                 configuration</h2>
                   3421:               </div>
                   3422:             </div>
                   3423:           </div>
                   3424: 
1.47      reed     3425:           <p>In this section, you can find some variables that
                   3426:           apply to all pkgsrc packages. The preferred method of
                   3427:           setting these variables is by setting them in
                   3428:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   3429:           class="filename">/etc/mk.conf</code>.</p>
1.45      wiz      3430: 
                   3431:           <div class="itemizedlist">
                   3432:             <ul type="disc">
                   3433:               <li>
                   3434:                 <p><code class="varname">LOCALBASE</code>: Where
                   3435:                 packages will be installed. The default is
                   3436:                 <code xmlns=
                   3437:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3438:                 "filename">/usr/pkg</code>. Do not mix binary
                   3439:                 packages with different <code class=
                   3440:                 "varname">LOCALBASE</code>s!</p>
                   3441:               </li>
                   3442: 
                   3443:               <li>
                   3444:                 <p><code class="varname">CROSSBASE</code>: Where
                   3445:                 &#8220;<span class="quote">cross</span>&#8221;
                   3446:                 category packages will be installed. The default is
                   3447:                 <code xmlns=
                   3448:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3449:                 "filename">${LOCALBASE}/cross</code>.</p>
                   3450:               </li>
                   3451: 
                   3452:               <li>
                   3453:                 <p><code class="varname">X11BASE</code>: Where X11
                   3454:                 is installed on the system. The default is
                   3455:                 <code xmlns=
                   3456:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3457:                 "filename">/usr/X11R6</code>.</p>
                   3458:               </li>
                   3459: 
                   3460:               <li>
                   3461:                 <p><code class="varname">DISTDIR</code>: Where to
                   3462:                 store the downloaded copies of the original source
                   3463:                 distributions used for building pkgsrc packages.
                   3464:                 The default is <code xmlns=
                   3465:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3466:                 "filename">${PKGSRCDIR}/distfiles</code>.</p>
                   3467:               </li>
                   3468: 
                   3469:               <li>
                   3470:                 <p><code class=
                   3471:                 "varname">MASTER_SITE_OVERRIDE</code>: If set,
                   3472:                 override the packages' <code class=
                   3473:                 "varname">MASTER_SITES</code> with this value.</p>
                   3474:               </li>
                   3475: 
                   3476:               <li>
                   3477:                 <p><code class="varname">MASTER_SITE_BACKUP</code>:
                   3478:                 Backup location(s) for distribution files and patch
                   3479:                 files if not found locally or in <code xmlns=
                   3480:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3481:                 "filename">${MASTER_SITES}</code> or <code xmlns=
                   3482:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3483:                 "filename">${PATCH_SITES}</code> respectively. The
                   3484:                 defaults are <code xmlns=
                   3485:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3486:                 "filename">ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}/</code>
                   3487:                 and <code xmlns=
                   3488:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3489:                 "filename">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/</code>.</p>
                   3490:               </li>
                   3491: 
                   3492:               <li>
                   3493:                 <p><code class="varname">BINPKG_SITES</code>: List
                   3494:                 of sites carrying binary pkgs.</p>
                   3495:               </li>
                   3496:             </ul>
                   3497:           </div>
                   3498:         </div>
                   3499: 
1.52      tv       3500:         <div class="sect1" lang="en">
1.45      wiz      3501:           <div class="titlepage">
                   3502:             <div>
                   3503:               <div>
                   3504:                 <h2 class="title" style="clear: both"><a name=
                   3505:                 "variables-affecting-build"></a>5.2.&nbsp;Variables
                   3506:                 affecting the build process</h2>
                   3507:               </div>
                   3508:             </div>
                   3509:           </div>
                   3510: 
                   3511:           <p>XXX</p>
                   3512: 
                   3513:           <div class="itemizedlist">
                   3514:             <ul type="disc">
                   3515:               <li>
                   3516:                 <p><code class="varname">PACKAGES</code>: The top
                   3517:                 level directory for the binary packages. The
                   3518:                 default is <code xmlns=
                   3519:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3520:                 "filename">${PKGSRCDIR}/packages</code>.</p>
                   3521:               </li>
                   3522: 
                   3523:               <li>
                   3524:                 <p><code class="varname">WRKOBJDIR</code>: The top
                   3525:                 level directory where, if defined, the separate
                   3526:                 working directories will get created, and
                   3527:                 symbolically linked to from <code xmlns=
                   3528:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3529:                 "filename">${WRKDIR}</code> (see below). This is
                   3530:                 useful for building packages on several
                   3531:                 architectures, then <code xmlns=
                   3532:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3533:                 "filename">${PKGSRCDIR}</code> can be NFS-mounted
                   3534:                 while <code xmlns=
                   3535:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3536:                 "filename">${WRKOBJDIR}</code> is local to every
                   3537:                 architecture. (It should be noted that <code class=
                   3538:                 "varname">PKGSRCDIR</code> should not be set by the
                   3539:                 user &#8212; it is an internal definition which
                   3540:                 refers to the root of the pkgsrc tree. It is
                   3541:                 possible to have many pkgsrc tree instances.)</p>
                   3542:               </li>
                   3543: 
                   3544:               <li>
                   3545:                 <p><code class="varname">LOCALPATCHES</code>:
                   3546:                 Directory for local patches that aren't part of
                   3547:                 pkgsrc. See <a href="#components.patches" title=
                   3548:                 "8.3.&nbsp;patches/*">Section&nbsp;8.3,
                   3549:                 &#8220;patches/*&#8221;</a> for more information.
                   3550:                 <em class="replaceable"><code>rel</code></em> and
                   3551:                 <em class="replaceable"><code>arch</code></em> are
                   3552:                 replaced with OS release (&#8220;<span class=
                   3553:                 "quote">2.0</span>&#8221;, etc.) and architecture
                   3554:                 (&#8220;<span class="quote">mipsel</span>&#8221;,
                   3555:                 etc.).</p>
                   3556:               </li>
                   3557: 
                   3558:               <li>
                   3559:                 <p><code class="varname">PKGMAKECONF</code>:
                   3560:                 Location of the <code xmlns=
                   3561:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3562:                 "filename">mk.conf</code> file used by a package's
                   3563:                 BSD-style Makefile. If this is not set,
                   3564:                 <code class="varname">MAKECONF</code> is set to
                   3565:                 <code xmlns=
                   3566:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3567:                 "filename">/dev/null</code> to avoid picking up
                   3568:                 settings used by builds in <code xmlns=
                   3569:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   3570:                 "filename">/usr/src</code>.</p>
                   3571:               </li>
                   3572:             </ul>
                   3573:           </div>
                   3574:         </div>
                   3575: 
1.52      tv       3576:         <div class="sect1" lang="en">
1.45      wiz      3577:           <div class="titlepage">
                   3578:             <div>
                   3579:               <div>
                   3580:                 <h2 class="title" style="clear: both"><a name=
                   3581:                 "developer-advanced-settings"></a>5.3.&nbsp;Developer/advanced
                   3582:                 settings</h2>
                   3583:               </div>
                   3584:             </div>
                   3585:           </div>
                   3586: 
                   3587:           <p>XXX</p>
                   3588: 
                   3589:           <div class="itemizedlist">
                   3590:             <ul type="disc">
                   3591:               <li>
                   3592:                 <p><code class="varname">PKG_DEVELOPER</code>: Run
                   3593:                 some sanity checks that package developers
                   3594:                 want:</p>
                   3595: 
                   3596:                 <div class="itemizedlist">
                   3597:                   <ul type="circle">
                   3598:                     <li>
                   3599:                       <p>make sure patches apply with zero fuzz</p>
                   3600:                     </li>
                   3601: 
                   3602:                     <li>
                   3603:                       <p>run check-shlibs to see that all binaries
                   3604:                       will find their shared libs.</p>
                   3605:                     </li>
                   3606:                   </ul>
                   3607:                 </div>
                   3608:               </li>
                   3609: 
                   3610:               <li>
                   3611:                 <p><code class="varname">PKG_DEBUG_LEVEL</code>:
                   3612:                 The level of debugging output which is displayed
                   3613:                 whilst making and installing the package. The
                   3614:                 default value for this is 0, which will not display
                   3615:                 the commands as they are executed (normal, default,
                   3616:                 quiet operation); the value 1 will display all
                   3617:                 shell commands before their invocation, and the
                   3618:                 value 2 will display both the shell commands before
                   3619:                 their invocation, and their actual execution
                   3620:                 progress with <span><strong class="command">set
                   3621:                 -x</strong></span> will be displayed.</p>
                   3622:               </li>
                   3623:             </ul>
                   3624:           </div>
                   3625:         </div>
                   3626: 
1.52      tv       3627:         <div class="sect1" lang="en">
1.45      wiz      3628:           <div class="titlepage">
                   3629:             <div>
                   3630:               <div>
                   3631:                 <h2 class="title" style="clear: both"><a name=
                   3632:                 "selecting-build-options"></a>5.4.&nbsp;Selecting
                   3633:                 Build Options</h2>
1.38      dillo    3634:               </div>
                   3635:             </div>
                   3636:           </div>
                   3637: 
                   3638:           <p>Some packages have build time options, usually to
                   3639:           select between different dependencies, enable optional
                   3640:           support for big dependencies or enable experimental
                   3641:           features.</p>
                   3642: 
                   3643:           <p>To see which options, if any, a package supports, and
                   3644:           which options are mutually exclusive, run
                   3645:           <span><strong class="command">make
                   3646:           show-options</strong></span>, for example:</p>
                   3647:           <pre class="programlisting">
1.51      rillig   3648:     The following options are supported by this package:
                   3649:     ssl      Enable SSL support.
                   3650:     Exactly one of the following gecko options is required:
                   3651:     firefox  Use firefox as gecko rendering engine.
                   3652:     mozilla  Use mozilla as gecko rendering engine.
                   3653:     At most one of the following database options may be selected:
                   3654:     mysql    Enable support for MySQL database.
                   3655:     pgsql    Enable support for PostgreSQL database.
                   3656: 
                   3657:     These options are enabled by default: firefox
                   3658:     These options are currently enabled: mozilla ssl
1.38      dillo    3659: </pre>
                   3660: 
1.45      wiz      3661:           <p>The following variables can be defined in <code xmlns=
                   3662:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.38      dillo    3663:           "filename">/etc/mk.conf</code> to select which options to
                   3664:           enable for a package: <code class=
                   3665:           "varname">PKG_DEFAULT_OPTIONS</code>, which can be used
                   3666:           to select or disable options for all packages that
                   3667:           support them, and <code class=
                   3668:           "varname">PKG_OPTIONS.<em class=
                   3669:           "replaceable"><code>pkgbase</code></em></code>, which can
                   3670:           be used to select or disable options specifically for
                   3671:           package <em class=
                   3672:           "replaceable"><code>pkgbase</code></em>. Options listed
                   3673:           in these variables are selected, options preceded by
                   3674:           &#8220;<span class="quote">-</span>&#8221; are
                   3675:           disabled.</p>
                   3676: 
1.39      dillo    3677:           <p>The following settings are consulted in the order
                   3678:           given, and the last setting that selects or disables an
                   3679:           option is used:</p>
1.38      dillo    3680: 
                   3681:           <div class="orderedlist">
                   3682:             <ol type="1">
                   3683:               <li>
                   3684:                 <p>the default options as suggested by the package
                   3685:                 maintainer</p>
                   3686:               </li>
                   3687: 
                   3688:               <li>
                   3689:                 <p>the options implied by the settings of legacy
                   3690:                 variables (see below)</p>
                   3691:               </li>
                   3692: 
                   3693:               <li>
                   3694:                 <p><code class=
                   3695:                 "varname">PKG_DEFAULT_OPTIONS</code></p>
                   3696:               </li>
                   3697: 
                   3698:               <li>
                   3699:                 <p><code class="varname">PKG_OPTIONS.<em class=
                   3700:                 "replaceable"><code>pkgbase</code></em></code></p>
                   3701:               </li>
                   3702:             </ol>
                   3703:           </div>
                   3704: 
                   3705:           <p>For groups of mutually exclusive options, the last
                   3706:           option selected is used, all others are automatically
                   3707:           disabled. If an option of the group is explicitly
                   3708:           disabled, the previously selected option, if any, is
                   3709:           used. It is an error if no option from a required group
                   3710:           of options is selected, and building the package will
                   3711:           fail.</p>
                   3712: 
                   3713:           <p>Before the options framework was introduced, build
                   3714:           options were selected by setting a variable in
1.45      wiz      3715:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   3716:           class="filename">/etc/mk.conf</code> for each option. To
                   3717:           ease transition to the options framework for the user,
                   3718:           these legacy variables are converted to the appropriate
                   3719:           options setting automatically. A warning is issued to
                   3720:           prompt the user to update <code xmlns=
                   3721:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.38      dillo    3722:           "filename">/etc/mk.conf</code> to use the options
                   3723:           framework directly. Support for these legacy variables
                   3724:           will be removed eventually.</p>
                   3725:         </div>
                   3726:       </div>
                   3727: 
1.52      tv       3728:       <div class="chapter" lang="en">
1.38      dillo    3729:         <div class="titlepage">
                   3730:           <div>
                   3731:             <div>
1.52      tv       3732:               <h2 class="title"><a name=
1.38      dillo    3733:               "binary"></a>Chapter&nbsp;6.&nbsp;Creating binary
1.1       grant    3734:               packages</h2>
                   3735:             </div>
                   3736:           </div>
                   3737:         </div>
                   3738: 
                   3739:         <div class="toc">
                   3740:           <p><b>Table of Contents</b></p>
                   3741: 
                   3742:           <dl>
1.30      wiz      3743:             <dt><span class="sect1"><a href=
1.38      dillo    3744:             "#building-a-single-binary-package">6.1. Building a
1.30      wiz      3745:             single binary package</a></span></dt>
1.1       grant    3746: 
1.30      wiz      3747:             <dt><span class="sect1"><a href=
1.38      dillo    3748:             "#settings-for-creationg-of-binary-packages">6.2.
1.1       grant    3749:             Settings for creation of binary
                   3750:             packages</a></span></dt>
                   3751: 
1.38      dillo    3752:             <dt><span class="sect1"><a href="#bulkbuild">6.3. Doing
1.1       grant    3753:             a bulk build of all packages</a></span></dt>
                   3754: 
                   3755:             <dd>
                   3756:               <dl>
                   3757:                 <dt><span class="sect2"><a href=
1.38      dillo    3758:                 "#binary.configuration">6.3.1.
1.1       grant    3759:                 Configuration</a></span></dt>
                   3760: 
1.30      wiz      3761:                 <dt><span class="sect2"><a href=
1.38      dillo    3762:                 "#other-environmental-considerations">6.3.2. Other
1.30      wiz      3763:                 environmental considerations</a></span></dt>
1.1       grant    3764: 
1.38      dillo    3765:                 <dt><span class="sect2"><a href="#operation">6.3.3.
1.1       grant    3766:                 Operation</a></span></dt>
                   3767: 
1.30      wiz      3768:                 <dt><span class="sect2"><a href=
1.38      dillo    3769:                 "#what-it-does">6.3.4. What it does</a></span></dt>
1.1       grant    3770: 
1.30      wiz      3771:                 <dt><span class="sect2"><a href=
1.38      dillo    3772:                 "#disk-space-requirements">6.3.5. Disk space
1.30      wiz      3773:                 requirements</a></span></dt>
1.1       grant    3774: 
1.30      wiz      3775:                 <dt><span class="sect2"><a href=
1.38      dillo    3776:                 "#setting-up-a-sandbox">6.3.6. Setting up a sandbox
1.47      reed     3777:                 for chrooted builds</a></span></dt>
1.1       grant    3778: 
1.30      wiz      3779:                 <dt><span class="sect2"><a href=
1.38      dillo    3780:                 "#building-a-partial-set">6.3.7. Building a partial
1.30      wiz      3781:                 set of packages</a></span></dt>
1.13      hubertf  3782: 
                   3783:                 <dt><span class="sect2"><a href=
1.38      dillo    3784:                 "#bulk-upload">6.3.8. Uploading results of a bulk
1.13      hubertf  3785:                 build</a></span></dt>
1.1       grant    3786:               </dl>
                   3787:             </dd>
                   3788: 
1.38      dillo    3789:             <dt><span class="sect1"><a href="#creating-cdroms">6.4.
1.1       grant    3790:             Creating a multiple CD-ROM packages
                   3791:             collection</a></span></dt>
                   3792: 
                   3793:             <dd>
                   3794:               <dl>
1.30      wiz      3795:                 <dt><span class="sect2"><a href=
1.38      dillo    3796:                 "#cdpack-example">6.4.1. Example of
1.30      wiz      3797:                 cdpack</a></span></dt>
1.1       grant    3798:               </dl>
                   3799:             </dd>
                   3800:           </dl>
                   3801:         </div>
                   3802: 
1.52      tv       3803:         <div class="sect1" lang="en">
1.1       grant    3804:           <div class="titlepage">
                   3805:             <div>
                   3806:               <div>
                   3807:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    3808:                 "building-a-single-binary-package"></a>6.1.&nbsp;Building
1.30      wiz      3809:                 a single binary package</h2>
1.1       grant    3810:               </div>
                   3811:             </div>
                   3812:           </div>
                   3813: 
                   3814:           <p>Once you have built and installed a package, you can
                   3815:           create a <span class="emphasis"><em>binary
                   3816:           package</em></span> which can be installed on another
                   3817:           system with <a href=
                   3818:           "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current">
                   3819:           <span class="citerefentry"><span class=
1.47      reed     3820:           "refentrytitle">pkg_add</span>(1)</span></a>. This saves
1.1       grant    3821:           having to build the same package on a group of hosts and
                   3822:           wasting CPU time. It also provides a simple means for
                   3823:           others to install your package, should you distribute
                   3824:           it.</p>
                   3825: 
                   3826:           <p>To create a binary package, change into the
1.14      xtraeme  3827:           appropriate directory in pkgsrc, and run
                   3828:           <span><strong class="command">make
                   3829:           package</strong></span>:</p>
1.1       grant    3830:           <pre class="screen">
1.14      xtraeme  3831: <code class="prompt">#</code> <strong class=
                   3832: "userinput"><code>cd misc/figlet</code></strong>
                   3833: <code class="prompt">#</code> <strong class=
                   3834: "userinput"><code>make package</code></strong>
1.1       grant    3835: </pre>
                   3836: 
                   3837:           <p>This will build and install your package (if not
                   3838:           already done), and then build a binary package from what
1.14      xtraeme  3839:           was installed. You can then use the <span><strong class=
                   3840:           "command">pkg_*</strong></span> tools to manipulate it.
1.45      wiz      3841:           Binary packages are created by default in <code xmlns=
                   3842:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3843:           "filename">/usr/pkgsrc/packages</code>, in the form of a
1.1       grant    3844:           gzipped tar file. See <a href="#logs.package" title=
1.52      tv       3845:           "B.2.&nbsp;Packaging figlet">Section&nbsp;B.2,
1.1       grant    3846:           &#8220;Packaging figlet&#8221;</a> for a continuation of
                   3847:           the above <a xmlns=
                   3848:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   3849:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/misc/figlet/README.html"
1.45      wiz      3850:           target="_top"><code xmlns="" class=
                   3851:           "filename">misc/figlet</code></a> example.</p>
1.1       grant    3852: 
                   3853:           <p>See <a href="#submit" title=
1.52      tv       3854:           "Chapter&nbsp;17.&nbsp;Submitting and Committing">Chapter&nbsp;17,
                   3855:           <i>Submitting and Committing</i></a> for information on
                   3856:           how to submit such a binary package.</p>
1.1       grant    3857:         </div>
                   3858: 
1.52      tv       3859:         <div class="sect1" lang="en">
1.1       grant    3860:           <div class="titlepage">
                   3861:             <div>
                   3862:               <div>
                   3863:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    3864:                 "settings-for-creationg-of-binary-packages"></a>6.2.&nbsp;Settings
1.1       grant    3865:                 for creation of binary packages</h2>
                   3866:               </div>
                   3867:             </div>
                   3868:           </div>
                   3869: 
                   3870:           <p>See <a href="#build.helpful-targets" title=
1.38      dillo    3871:           "14.3.&nbsp;Other helpful targets">Section&nbsp;14.3,
1.1       grant    3872:           &#8220;Other helpful targets&#8221;</a>.</p>
                   3873:         </div>
                   3874: 
1.52      tv       3875:         <div class="sect1" lang="en">
1.1       grant    3876:           <div class="titlepage">
                   3877:             <div>
                   3878:               <div>
                   3879:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       3880:                 "bulkbuild"></a>6.3.&nbsp;Doing a bulk build of all
                   3881:                 packages</h2>
1.1       grant    3882:               </div>
                   3883:             </div>
                   3884:           </div>
                   3885: 
                   3886:           <p>If you want to get a full set of precompiled binary
                   3887:           packages, this section describes how to get them. Beware
                   3888:           that the bulk build will remove all currently installed
1.23      wiz      3889:           packages from your system! Having an FTP server
                   3890:           configured either on the machine doing the bulk builds or
                   3891:           on a nearby NFS server can help to make the packages
                   3892:           available to everyone. See <a href=
1.1       grant    3893:           "http://netbsd.gw.com/cgi-bin/man-cgi?ftpd+8+NetBSD-current">
                   3894:           <span class="citerefentry"><span class=
                   3895:           "refentrytitle">ftpd</span>(8)</span></a> for more
                   3896:           information. If you use a remote NFS server's storage, be
                   3897:           sure to not actually compile on NFS storage, as this
                   3898:           slows things down a lot.</p>
                   3899: 
1.52      tv       3900:           <div class="sect2" lang="en">
1.1       grant    3901:             <div class="titlepage">
                   3902:               <div>
                   3903:                 <div>
1.52      tv       3904:                   <h3 class="title"><a name=
1.38      dillo    3905:                   "binary.configuration"></a>6.3.1.&nbsp;Configuration</h3>
1.1       grant    3906:                 </div>
                   3907:               </div>
                   3908:             </div>
                   3909: 
1.52      tv       3910:             <div class="sect3" lang="en">
1.1       grant    3911:               <div class="titlepage">
                   3912:                 <div>
                   3913:                   <div>
1.52      tv       3914:                     <h4 class="title"><a name=
1.38      dillo    3915:                     "binary.mk.conf"></a>6.3.1.1.&nbsp;/etc/mk.conf</h4>
1.1       grant    3916:                   </div>
                   3917:                 </div>
                   3918:               </div>
                   3919: 
1.45      wiz      3920:               <p>You may want to set variables in <code xmlns=
                   3921:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   3922:               "filename">/etc/mk.conf</code>. Look at <code xmlns=
                   3923:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3924:               "filename">pkgsrc/mk/defaults/mk.conf</code> for
1.1       grant    3925:               details of the default settings. You will want to
1.14      xtraeme  3926:               ensure that <code class=
                   3927:               "varname">ACCEPTABLE_LICENSES</code> meet your local
                   3928:               policy. As used in this example, <code class=
                   3929:               "varname">_ACCEPTABLE=yes</code> accepts <span class=
1.1       grant    3930:               "emphasis"><em>all</em></span> licenses.</p>
                   3931:               <pre class="programlisting">
1.51      rillig   3932:     PACKAGES?=      ${_PKGSRCDIR}/packages/${MACHINE_ARCH}
                   3933:     WRKOBJDIR?=     /usr/tmp/pkgsrc   # build here instead of in pkgsrc
                   3934:     BSDSRCDIR=      /usr/src
                   3935:     BSDXSRCDIR=     /usr/xsrc         # for x11/xservers
                   3936:     OBJHOSTNAME?=   yes               # use work.`hostname`
                   3937:     FAILOVER_FETCH= yes               # insist on the correct checksum
                   3938:     PKG_DEVELOPER?= yes
                   3939:     _ACCEPTABLE=    yes
1.1       grant    3940: </pre>
                   3941:             </div>
                   3942: 
1.52      tv       3943:             <div class="sect3" lang="en">
1.1       grant    3944:               <div class="titlepage">
                   3945:                 <div>
                   3946:                   <div>
1.52      tv       3947:                     <h4 class="title"><a name=
1.45      wiz      3948:                     "build.conf"></a>6.3.1.2.&nbsp;<code xmlns=
                   3949:                     "http://www.w3.org/TR/xhtml1/transitional"
                   3950:                     class="filename">build.conf</code></h4>
1.1       grant    3951:                   </div>
                   3952:                 </div>
                   3953:               </div>
                   3954: 
1.45      wiz      3955:               <p>In <code xmlns=
                   3956:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   3957:               "filename">pkgsrc/mk/bulk</code>, copy <code xmlns=
                   3958:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   3959:               "filename">build.conf-example</code> to <code xmlns=
                   3960:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   3961:               "filename">build.conf</code> and edit it, following
                   3962:               the comments in that file. This is the config file
                   3963:               that determines where log files are generated after
                   3964:               the build, where to mail the build report to, where
                   3965:               your pkgsrc tree is located and the user to which
                   3966:               user to <a href=
1.1       grant    3967:               "http://netbsd.gw.com/cgi-bin/man-cgi?su+8+NetBSD-current">
                   3968:               <span class="citerefentry"><span class=
1.23      wiz      3969:               "refentrytitle">su</span>(8)</span></a> to do a
1.14      xtraeme  3970:               <span><strong class="command">cvs
                   3971:               update</strong></span>.</p>
1.1       grant    3972:             </div>
                   3973: 
1.52      tv       3974:             <div class="sect3" lang="en">
1.1       grant    3975:               <div class="titlepage">
                   3976:                 <div>
                   3977:                   <div>
1.52      tv       3978:                     <h4 class="title"><a name=
1.45      wiz      3979:                     "pre-build.local"></a>6.3.1.3.&nbsp;<code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   3980:                     class="filename">pre-build.local</code></h4>
1.1       grant    3981:                   </div>
                   3982:                 </div>
                   3983:               </div>
                   3984: 
                   3985:               <p>It is possible to configure the bulk build to
1.47      reed     3986:               perform certain site-specific tasks at the end of the
1.45      wiz      3987:               pre-build stage. If the file <code xmlns=
                   3988:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  3989:               "filename">pre-build.local</code> exists in
1.45      wiz      3990:               <code xmlns=
                   3991:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   3992:               "filename">/usr/pkgsrc/mk/bulk</code>, it will be
                   3993:               executed (as a <a href=
1.24      wiz      3994:               "http://netbsd.gw.com/cgi-bin/man-cgi?sh+1+NetBSD-current">
                   3995:               <span class="citerefentry"><span class=
                   3996:               "refentrytitle">sh</span>(1)</span></a> script) at
                   3997:               the end of the usual pre-build stage. An example use
1.45      wiz      3998:               of <code xmlns=
                   3999:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   4000:               "filename">pre-build.local</code> is to have the
                   4001:               line:</p>
1.1       grant    4002:               <pre class="screen">
1.14      xtraeme  4003: <code class="prompt">#</code> <strong class=
                   4004: "userinput"><code>echo "I do not have enough disk space to build this pig." \
1.23      wiz      4005:     &gt; pkgsrc/misc/openoffice/$BROKENF</code></strong>
1.1       grant    4006: </pre>
                   4007: 
                   4008:               <p>to prevent the system from trying to build a
                   4009:               particular package which requires nearly 3 GB of disk
                   4010:               space.</p>
                   4011:             </div>
                   4012:           </div>
                   4013: 
1.52      tv       4014:           <div class="sect2" lang="en">
1.1       grant    4015:             <div class="titlepage">
                   4016:               <div>
                   4017:                 <div>
1.30      wiz      4018:                   <h3 class="title"><a name=
1.38      dillo    4019:                   "other-environmental-considerations"></a>6.3.2.&nbsp;Other
1.30      wiz      4020:                   environmental considerations</h3>
1.1       grant    4021:                 </div>
                   4022:               </div>
                   4023:             </div>
                   4024: 
1.45      wiz      4025:             <p>As <code xmlns=
                   4026:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   4027:             "filename">/usr/pkg</code> will be completely deleted
                   4028:             at the start of bulk builds, make sure your login shell
                   4029:             is placed somewhere else. Either drop it into
                   4030:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4031:             class="filename">/usr/local/bin</code> (and adjust your
                   4032:             login shell in the passwd file), or (re-)install it via
1.14      xtraeme  4033:             <a href=
1.1       grant    4034:             "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current">
                   4035:             <span class="citerefentry"><span class=
                   4036:             "refentrytitle">pkg_add</span>(1)</span></a> from
1.45      wiz      4037:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4038:             class="filename">/etc/rc.local</code>, so you can login
                   4039:             after a reboot (remember that your current process
                   4040:             won't die if the package is removed, you just can't
                   4041:             start any new instances of the shell any more). Also,
                   4042:             if you use NetBSD earlier than 1.5, or you still want
                   4043:             to use the pkgsrc version of ssh for some reason, be
                   4044:             sure to install ssh before starting it from
                   4045:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4046:             class="filename">rc.local</code>:</p>
1.1       grant    4047:             <pre class="programlisting">
1.51      rillig   4048:     ( cd /usr/pkgsrc/security/ssh ; make bulk-install )
                   4049:     if [ -f /usr/pkg/etc/rc.d/sshd ]; then
                   4050:         /usr/pkg/etc/rc.d/sshd
                   4051:     fi
1.1       grant    4052: </pre>
                   4053: 
                   4054:             <p>Not doing so will result in you being not able to
                   4055:             log in via ssh after the bulk build is finished or if
                   4056:             the machine gets rebooted or crashes. You have been
                   4057:             warned! :)</p>
                   4058:           </div>
                   4059: 
1.52      tv       4060:           <div class="sect2" lang="en">
1.1       grant    4061:             <div class="titlepage">
                   4062:               <div>
                   4063:                 <div>
1.52      tv       4064:                   <h3 class="title"><a name=
1.38      dillo    4065:                   "operation"></a>6.3.3.&nbsp;Operation</h3>
1.1       grant    4066:                 </div>
                   4067:               </div>
                   4068:             </div>
                   4069: 
                   4070:             <p>Make sure you don't need any of the packages still
                   4071:             installed.</p>
                   4072: 
                   4073:             <div class="warning" style=
                   4074:             "margin-left: 0.5in; margin-right: 0.5in;">
                   4075:               <h3 class="title">Warning</h3>
                   4076: 
                   4077:               <p>During the bulk build, <span class=
                   4078:               "emphasis"><em>all packages will be
                   4079:               removed!</em></span></p>
                   4080:             </div>
                   4081: 
                   4082:             <p>Be sure to remove all other things that might
                   4083:             interfere with builds, like some libs installed in
1.45      wiz      4084:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4085:             class="filename">/usr/local</code>, etc. then become
                   4086:             root and type:</p>
1.1       grant    4087:             <pre class="screen">
1.14      xtraeme  4088: <code class="prompt">#</code> <strong class=
                   4089: "userinput"><code>cd /usr/pkgsrc</code></strong>
                   4090: <code class="prompt">#</code> <strong class=
                   4091: "userinput"><code>sh mk/bulk/build</code></strong>
1.1       grant    4092: </pre>
                   4093: 
                   4094:             <p>If for some reason your last build didn't complete
                   4095:             (power failure, system panic, ...), you can continue it
                   4096:             by running:</p>
                   4097:             <pre class="screen">
1.14      xtraeme  4098: <code class="prompt">#</code> <strong class=
                   4099: "userinput"><code>sh mk/bulk/build restart</code></strong>
1.1       grant    4100: </pre>
                   4101: 
                   4102:             <p>At the end of the bulk build, you will get a summary
                   4103:             via mail, and find build logs in the directory
1.14      xtraeme  4104:             specified by <code class="varname">FTP</code> in the
1.45      wiz      4105:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4106:             class="filename">build.conf</code> file.</p>
1.1       grant    4107:           </div>
                   4108: 
1.52      tv       4109:           <div class="sect2" lang="en">
1.1       grant    4110:             <div class="titlepage">
                   4111:               <div>
                   4112:                 <div>
1.52      tv       4113:                   <h3 class="title"><a name=
1.38      dillo    4114:                   "what-it-does"></a>6.3.4.&nbsp;What it does</h3>
1.1       grant    4115:                 </div>
                   4116:               </div>
                   4117:             </div>
                   4118: 
                   4119:             <p>The bulk builds consist of three steps:</p>
                   4120: 
                   4121:             <div class="variablelist">
                   4122:               <dl>
                   4123:                 <dt><span class="term">1. pre-build</span></dt>
                   4124: 
                   4125:                 <dd>
                   4126:                   <p>The script updates your pkgsrc tree via
                   4127:                   (anon)cvs, then cleans out any broken distfiles,
                   4128:                   and removes all packages installed.</p>
                   4129:                 </dd>
                   4130: 
                   4131:                 <dt><span class="term">2. the bulk
                   4132:                 build</span></dt>
                   4133: 
                   4134:                 <dd>
                   4135:                   <p>This is basically &#8220;<span class=
                   4136:                   "quote">make bulk-package</span>&#8221; with an
                   4137:                   optimised order in which packages will be built.
                   4138:                   Packages that don't require other packages will
                   4139:                   be built first, and packages with many
                   4140:                   dependencies will be built later.</p>
                   4141:                 </dd>
                   4142: 
                   4143:                 <dt><span class="term">3. post-build</span></dt>
                   4144: 
                   4145:                 <dd>
                   4146:                   <p>Generates a report that's placed in the
1.45      wiz      4147:                   directory specified in the <code xmlns=
                   4148:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4149:                   "filename">build.conf</code> file named
1.45      wiz      4150:                   <code xmlns=
                   4151:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   4152:                   "filename">broken.html</code>, a short version of
                   4153:                   that report will also be mailed to the build's
                   4154:                   admin.</p>
1.1       grant    4155:                 </dd>
                   4156:               </dl>
                   4157:             </div>
                   4158: 
                   4159:             <p>During the build, a list of broken packages will be
1.45      wiz      4160:             compiled in <code xmlns=
                   4161:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   4162:             "filename">/usr/pkgsrc/.broken</code> (or <code xmlns=
                   4163:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4164:             "filename">.../.broken.${MACHINE}</code> if
                   4165:             <code class="varname">OBJMACHINE</code> is set),
                   4166:             individual build logs of broken builds can be found in
                   4167:             the package's directory. These files are used by the
                   4168:             bulk-targets to mark broken builds to not waste time
                   4169:             trying to rebuild them, and they can be used to debug
                   4170:             these broken package builds later.</p>
1.1       grant    4171:           </div>
                   4172: 
1.52      tv       4173:           <div class="sect2" lang="en">
1.1       grant    4174:             <div class="titlepage">
                   4175:               <div>
                   4176:                 <div>
1.30      wiz      4177:                   <h3 class="title"><a name=
1.38      dillo    4178:                   "disk-space-requirements"></a>6.3.5.&nbsp;Disk
1.30      wiz      4179:                   space requirements</h3>
1.1       grant    4180:                 </div>
                   4181:               </div>
                   4182:             </div>
                   4183: 
                   4184:             <p>Currently, roughly the following requirements are
                   4185:             valid for NetBSD 2.0/i386:</p>
                   4186: 
                   4187:             <div class="itemizedlist">
                   4188:               <ul type="disc">
                   4189:                 <li>
                   4190:                   <p>10 GB - distfiles (NFS ok)</p>
                   4191:                 </li>
                   4192: 
                   4193:                 <li>
                   4194:                   <p>8 GB - full set of all binaries (NFS ok)</p>
                   4195:                 </li>
                   4196: 
                   4197:                 <li>
                   4198:                   <p>5 GB - temp space for compiling (local disk
                   4199:                   recommended)</p>
                   4200:                 </li>
                   4201:               </ul>
                   4202:             </div>
                   4203: 
                   4204:             <p>Note that all pkgs will be de-installed as soon as
                   4205:             they are turned into a binary package, and that sources
                   4206:             are removed, so there is no excessively huge demand to
                   4207:             disk space. Afterwards, if the package is needed again,
                   4208:             it will be installed via <a href=
                   4209:             "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current">
                   4210:             <span class="citerefentry"><span class=
                   4211:             "refentrytitle">pkg_add</span>(1)</span></a> instead of
                   4212:             building again, so there are no cycles wasted by
                   4213:             recompiling.</p>
                   4214:           </div>
                   4215: 
1.52      tv       4216:           <div class="sect2" lang="en">
1.1       grant    4217:             <div class="titlepage">
                   4218:               <div>
                   4219:                 <div>
1.52      tv       4220:                   <h3 class="title"><a name=
                   4221:                   "setting-up-a-sandbox"></a>6.3.6.&nbsp;Setting up
                   4222:                   a sandbox for chrooted builds</h3>
1.1       grant    4223:                 </div>
                   4224:               </div>
                   4225:             </div>
                   4226: 
1.12      agc      4227:             <p>If you don't want all the packages nuked from a
                   4228:             machine (rendering it useless for anything but pkg
1.23      wiz      4229:             compiling), there is the possibility of doing the
                   4230:             package bulk build inside a chroot environment.</p>
1.12      agc      4231: 
                   4232:             <p>The first step is to set up a chroot sandbox, e.g.
1.45      wiz      4233:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4234:             class="filename">/usr/sandbox</code>. This can be done
                   4235:             by using null mounts, or manually.</p>
1.12      agc      4236: 
1.45      wiz      4237:             <p>There is a shell script called <code xmlns=
                   4238:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4239:             "filename">pkgsrc/mk/bulk/mksandbox</code> which will
                   4240:             set up the sandbox environment using null mounts. It
1.45      wiz      4241:             will also create a script called <code xmlns=
                   4242:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4243:             "filename">sandbox</code> in the root of the sandbox
1.12      agc      4244:             environment, which will allow the null mounts to be
1.14      xtraeme  4245:             activated using the <span><strong class=
                   4246:             "command">sandbox mount</strong></span> command and
                   4247:             deactivated using the <span><strong class=
                   4248:             "command">sandbox umount</strong></span> command.</p>
1.12      agc      4249: 
                   4250:             <p>To set up a sandbox environment by hand, after
                   4251:             extracting all the sets from a NetBSD installation or
1.14      xtraeme  4252:             doing a <span><strong class="command">make distribution
1.45      wiz      4253:             DESTDIR=/usr/sandbox</strong></span> in <code xmlns=
                   4254:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4255:             "filename">/usr/src/etc</code>, be sure the following
1.7       wiz      4256:             items are present and properly configured:</p>
1.1       grant    4257: 
                   4258:             <div class="procedure">
                   4259:               <ol type="1">
                   4260:                 <li>
                   4261:                   <p>Kernel</p>
                   4262:                   <pre class="screen">
1.14      xtraeme  4263: <code class="prompt">#</code> <strong class=
                   4264: "userinput"><code>cp /netbsd /usr/sandbox</code></strong>
1.1       grant    4265: </pre>
                   4266:                 </li>
                   4267: 
                   4268:                 <li>
1.45      wiz      4269:                   <p><code xmlns=
                   4270:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   4271:                   "filename">/dev/*</code></p>
1.1       grant    4272:                   <pre class="screen">
1.14      xtraeme  4273: <code class="prompt">#</code> <strong class=
                   4274: "userinput"><code>cd /usr/sandbox/dev ; sh MAKEDEV all</code></strong>
1.1       grant    4275: </pre>
                   4276:                 </li>
                   4277: 
                   4278:                 <li>
1.45      wiz      4279:                   <p><code xmlns=
                   4280:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   4281:                   "filename">/etc/resolv.conf</code> (for <a xmlns=
1.1       grant    4282:                   "http://www.w3.org/TR/xhtml1/transitional" href=
                   4283:                   "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/smtpd/README.html"
1.45      wiz      4284:                   target="_top"><code xmlns="" class=
                   4285:                   "filename">security/smtpd</code></a> and
                   4286:                   mail):</p>
1.1       grant    4287:                   <pre class="screen">
1.14      xtraeme  4288: <code class="prompt">#</code> <strong class=
                   4289: "userinput"><code>cp /etc/resolv.conf /usr/sandbox/etc</code></strong>
1.1       grant    4290: </pre>
                   4291:                 </li>
                   4292: 
                   4293:                 <li>
                   4294:                   <p>Working(!) mail config (hostname,
                   4295:                   sendmail.cf):</p>
                   4296:                   <pre class="screen">
1.14      xtraeme  4297: <code class="prompt">#</code> <strong class=
                   4298: "userinput"><code>cp /etc/mail/sendmail.cf /usr/sandbox/etc/mail</code></strong>
1.1       grant    4299: </pre>
                   4300:                 </li>
                   4301: 
                   4302:                 <li>
1.45      wiz      4303:                   <p><code xmlns=
                   4304:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   4305:                   "filename">/etc/localtime</code> (for <a xmlns=
1.1       grant    4306:                   "http://www.w3.org/TR/xhtml1/transitional" href=
                   4307:                   "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/smtpd/README.html"
1.45      wiz      4308:                   target="_top"><code xmlns="" class=
                   4309:                   "filename">security/smtpd</code></a>):</p>
1.1       grant    4310:                   <pre class="screen">
1.14      xtraeme  4311: <code class="prompt">#</code> <strong class=
                   4312: "userinput"><code>ln -sf /usr/share/zoneinfo/UTC /usr/sandbox/etc/localtime</code></strong>
1.1       grant    4313: </pre>
                   4314:                 </li>
                   4315: 
                   4316:                 <li>
1.45      wiz      4317:                   <p><code xmlns=
                   4318:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   4319:                   "filename">/usr/src</code> (system sources, for
                   4320:                   <a xmlns=
1.1       grant    4321:                   "http://www.w3.org/TR/xhtml1/transitional" href=
                   4322:                   "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/sysutils/aperture/README.html"
1.45      wiz      4323:                   target="_top"><code xmlns="" class=
                   4324:                   "filename">sysutils/aperture</code></a>,
                   4325:                   <a xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4326:                   href=
1.20      ben      4327:                   "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/net/ppp-mppe/README.html"
1.45      wiz      4328:                   target="_top"><code xmlns="" class=
                   4329:                   "filename">net/ppp-mppe</code></a>):</p>
1.1       grant    4330:                   <pre class="screen">
1.14      xtraeme  4331: <code class="prompt">#</code> <strong class=
                   4332: "userinput"><code>ln -s ../disk1/cvs .</code></strong>
                   4333: <code class="prompt">#</code> <strong class=
1.23      wiz      4334: "userinput"><code>ln -s cvs/src-2.0 src</code></strong>
1.1       grant    4335: </pre>
                   4336:                 </li>
                   4337: 
                   4338:                 <li>
1.45      wiz      4339:                   <p>Create <code xmlns=
                   4340:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4341:                   "filename">/var/db/pkg</code> (not part of
                   4342:                   default install):</p>
1.1       grant    4343:                   <pre class="screen">
1.14      xtraeme  4344: <code class="prompt">#</code> <strong class=
                   4345: "userinput"><code>mkdir /usr/sandbox/var/db/pkg</code></strong>
1.1       grant    4346: </pre>
                   4347:                 </li>
                   4348: 
                   4349:                 <li>
1.45      wiz      4350:                   <p>Create <code xmlns=
                   4351:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   4352:                   "filename">/usr/pkg</code> (not part of default
                   4353:                   install):</p>
1.1       grant    4354:                   <pre class="screen">
1.14      xtraeme  4355: <code class="prompt">#</code> <strong class=
                   4356: "userinput"><code>mkdir /usr/sandbox/usr/pkg</code></strong>
1.1       grant    4357: </pre>
                   4358:                 </li>
                   4359: 
                   4360:                 <li>
1.45      wiz      4361:                   <p>Checkout pkgsrc via cvs into <code xmlns=
                   4362:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4363:                   "filename">/usr/sandbox/usr/pkgsrc</code>:</p>
1.1       grant    4364:                   <pre class="screen">
1.14      xtraeme  4365: <code class="prompt">#</code> <strong class=
                   4366: "userinput"><code>cd /usr/sandbox/usr</code></strong>
                   4367: <code class="prompt">#</code> <strong class=
                   4368: "userinput"><code>cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -d -P pkgsrc</code></strong>
1.1       grant    4369: </pre>
                   4370: 
                   4371:                   <p>Do not mount/link this to the copy of your
                   4372:                   pkgsrc tree you do development in, as this will
                   4373:                   likely cause problems!</p>
                   4374:                 </li>
                   4375: 
                   4376:                 <li>
1.45      wiz      4377:                   <p>Make <code xmlns=
                   4378:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4379:                   "filename">/usr/sandbox/usr/pkgsrc/packages</code>
1.45      wiz      4380:                   and <code xmlns=
                   4381:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   4382:                   "filename">.../distfiles</code> point somewhere
                   4383:                   appropriate. NFS- and/or nullfs-mounts may come
                   4384:                   in handy!</p>
1.1       grant    4385:                 </li>
                   4386: 
                   4387:                 <li>
1.45      wiz      4388:                   <p>Edit <code xmlns=
                   4389:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4390:                   "filename">/etc/mk.conf</code>, see <a href=
                   4391:                   "#binary.mk.conf" title=
1.38      dillo    4392:                   "6.3.1.1.&nbsp;/etc/mk.conf">Section&nbsp;6.3.1.1,
1.1       grant    4393:                   &#8220;/etc/mk.conf&#8221;</a>.</p>
                   4394:                 </li>
                   4395: 
                   4396:                 <li>
1.45      wiz      4397:                   <p>Adjust <code xmlns=
                   4398:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4399:                   "filename">mk/bulk/build.conf</code> to suit your
1.1       grant    4400:                   needs.</p>
                   4401:                 </li>
                   4402: 
                   4403:                 <li>
1.14      xtraeme  4404:                   <p>If you have set <code class=
1.45      wiz      4405:                   "varname">CVS_USER</code> in <code xmlns=
                   4406:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4407:                   "filename">build.conf</code>, make sure that
                   4408:                   account exists and can do a <span><strong class=
                   4409:                   "command">cvs ${CVS_FLAGS} update</strong></span>
1.1       grant    4410:                   properly!</p>
                   4411:                 </li>
                   4412:               </ol>
                   4413:             </div>
                   4414: 
1.47      reed     4415:             <p>When the chroot sandbox is set up, you can start the
1.1       grant    4416:             build with the following steps:</p>
                   4417:             <pre class="screen">
1.14      xtraeme  4418: <code class="prompt">#</code> <strong class=
                   4419: "userinput"><code>cd /usr/sandbox/usr/pkgsrc</code></strong>
                   4420: <code class="prompt">#</code> <strong class=
                   4421: "userinput"><code>sh mk/bulk/do-sandbox-build</code></strong>
1.1       grant    4422: </pre>
                   4423: 
                   4424:             <p>This will just jump inside the sandbox and start
                   4425:             building. At the end of the build, mail will be sent
                   4426:             with the results of the build. Created binary pkgs will
1.45      wiz      4427:             be in <code xmlns=
                   4428:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4429:             "filename">/usr/sandbox/usr/pkgsrc/packages</code>
1.1       grant    4430:             (wherever that points/mounts to/from).</p>
                   4431:           </div>
                   4432: 
1.52      tv       4433:           <div class="sect2" lang="en">
1.1       grant    4434:             <div class="titlepage">
                   4435:               <div>
                   4436:                 <div>
1.30      wiz      4437:                   <h3 class="title"><a name=
1.38      dillo    4438:                   "building-a-partial-set"></a>6.3.7.&nbsp;Building
1.30      wiz      4439:                   a partial set of packages</h3>
1.1       grant    4440:                 </div>
                   4441:               </div>
                   4442:             </div>
                   4443: 
                   4444:             <p>In addition to building a complete set of all
1.45      wiz      4445:             packages in pkgsrc, the <code xmlns=
                   4446:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4447:             "filename">pkgsrc/mk/bulk/build</code> script may be
                   4448:             used to build a subset of the packages contained in
1.47      reed     4449:             pkgsrc. By setting <code class=
1.45      wiz      4450:             "varname">SPECIFIC_PKGS</code> in <code xmlns=
                   4451:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4452:             "filename">/etc/mk.conf</code>, the variables</p>
1.1       grant    4453: 
                   4454:             <div class="itemizedlist">
                   4455:               <ul type="disc">
                   4456:                 <li>
                   4457:                   <p>SITE_SPECIFIC_PKGS</p>
                   4458:                 </li>
                   4459: 
                   4460:                 <li>
                   4461:                   <p>HOST_SPECIFIC_PKGS</p>
                   4462:                 </li>
                   4463: 
                   4464:                 <li>
                   4465:                   <p>GROUP_SPECIFIC_PKGS</p>
                   4466:                 </li>
                   4467: 
                   4468:                 <li>
                   4469:                   <p>USER_SPECIFIC_PKGS</p>
                   4470:                 </li>
                   4471:               </ul>
                   4472:             </div>
                   4473: 
                   4474:             <p>will define the set of packages which should be
                   4475:             built. The bulk build code will also include any
                   4476:             packages which are needed as dependencies for the
                   4477:             explicitly listed packages.</p>
                   4478: 
                   4479:             <p>One use of this is to do a bulk build with
1.14      xtraeme  4480:             <code class="varname">SPECIFIC_PKGS</code> in a chroot
1.1       grant    4481:             sandbox periodically to have a complete set of the
                   4482:             binary packages needed for your site available without
                   4483:             the overhead of building extra packages that are not
                   4484:             needed.</p>
                   4485:           </div>
1.13      hubertf  4486: 
1.52      tv       4487:           <div class="sect2" lang="en">
1.13      hubertf  4488:             <div class="titlepage">
                   4489:               <div>
                   4490:                 <div>
1.52      tv       4491:                   <h3 class="title"><a name=
1.38      dillo    4492:                   "bulk-upload"></a>6.3.8.&nbsp;Uploading results
1.13      hubertf  4493:                   of a bulk build</h3>
                   4494:                 </div>
                   4495:               </div>
                   4496:             </div>
                   4497: 
                   4498:             <p>This section describes how pkgsrc developers can
                   4499:             upload binary pkgs built by bulk builds to
                   4500:             ftp.NetBSD.org.</p>
                   4501: 
1.17      sketch   4502:             <p>If you would like to automatically create checksum
                   4503:             files for the binary packages you intend to upload,
                   4504:             remember to set <code class="varname">MKSUMS=yes</code>
1.45      wiz      4505:             in your <code xmlns=
                   4506:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.17      sketch   4507:             "filename">mk/bulk/build.conf</code>.</p>
                   4508: 
                   4509:             <p>If you would like to PGP sign the checksum files
                   4510:             (highly recommended!), remember to set <code class=
                   4511:             "varname">SIGN_AS=username@NetBSD.org</code> in your
1.45      wiz      4512:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4513:             class="filename">mk/bulk/build.conf</code>. This will
                   4514:             prompt you for your GPG password to sign the files
1.17      sketch   4515:             before uploading everything.</p>
                   4516: 
                   4517:             <p>Then, make sure that you have <code class=
1.14      xtraeme  4518:             "varname">RSYNC_DST</code> set properly in your
1.45      wiz      4519:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4520:             class="filename">mk/bulk/build.conf</code> file, i.e.
                   4521:             adjust it to something like one of the following:</p>
1.13      hubertf  4522:             <pre class="screen">
                   4523: RSYNC_DST=$CVS_USER@ftp.NetBSD.org:/pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload 
                   4524: </pre>
                   4525: 
1.47      reed     4526:             <p>Please use appropriate values for "pkgsrc-200xQy",
1.13      hubertf  4527:             "NetBSD-a.b.c" and "arch" here. If your login on
1.14      xtraeme  4528:             ftp.NetBSD.org is different from <code class=
                   4529:             "varname">CVS_USER</code>, write your login directly
                   4530:             into the variable, e.g. my local account is "feyrer",
                   4531:             but for my login "hubertf", I use:</p>
1.13      hubertf  4532:             <pre class="screen">
                   4533: RSYNC_DST=hubertf@ftp.NetBSD.org:/pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload 
                   4534: </pre>
                   4535: 
1.45      wiz      4536:             <p>A separate <code xmlns=
                   4537:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   4538:             "filename">upload</code> directory is used here to
                   4539:             allow "closing" the directory during upload. To do so,
                   4540:             run the following command on ftp.NetBSD.org next:</p>
1.13      hubertf  4541:             <pre class="screen">
1.14      xtraeme  4542: nbftp% <strong class=
                   4543: "userinput"><code>mkdir -p -m 750 /pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload</code></strong>
1.13      hubertf  4544: </pre>
                   4545: 
1.45      wiz      4546:             <p>Please note that <code xmlns=
                   4547:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4548:             "filename">/pub/NetBSD/packages</code> is only
1.13      hubertf  4549:             appropriate for packages for the NetBSD operating
                   4550:             system. Binary packages for other operating systems
1.45      wiz      4551:             should go into <code xmlns=
                   4552:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4553:             "filename">/pub/pkgsrc</code>.</p>
1.13      hubertf  4554: 
                   4555:             <p>Before uploading the binary pkgs, ssh authentication
1.47      reed     4556:             needs to be set up. This example shows how to set up
1.13      hubertf  4557:             temporary keys for the root account <span class=
                   4558:             "emphasis"><em>inside the sandbox</em></span> (assuming
                   4559:             that no keys should be present there usually):</p>
                   4560:             <pre class="screen">
1.14      xtraeme  4561: <code class="prompt">#</code> <strong class=
                   4562: "userinput"><code>chroot /usr/sandbox</code></strong>        
                   4563: chroot-<code class="prompt">#</code> <strong class=
                   4564: "userinput"><code>rm $HOME/.ssh/id-dsa*</code></strong>        
                   4565: chroot-<code class="prompt">#</code> <strong class=
                   4566: "userinput"><code>ssh-keygen -t dsa</code></strong>        
                   4567: chroot-<code class="prompt">#</code> <strong class=
                   4568: "userinput"><code>cat $HOME/.ssh/id-dsa.pub</code></strong> 
1.13      hubertf  4569: </pre>
                   4570: 
1.45      wiz      4571:             <p>Now take the output of <code xmlns=
                   4572:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4573:             "filename">id-dsa.pub</code> and append it to your
1.45      wiz      4574:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4575:             class="filename">~/.ssh/authorized_keys</code> file on
                   4576:             ftp.NetBSD.org. You can remove the key after the upload
                   4577:             is done!</p>
1.13      hubertf  4578: 
                   4579:             <p>Next, test if your ssh connection really works:</p>
                   4580:             <pre class="screen">
1.14      xtraeme  4581: chroot-<code class="prompt">#</code> <strong class=
                   4582: "userinput"><code>ssh ftp.NetBSD.org date</code></strong> 
1.13      hubertf  4583: </pre>
                   4584: 
                   4585:             <p>Use "-l yourNetBSDlogin" here as appropriate!</p>
                   4586: 
                   4587:             <p>Now after all this works, you can exit the sandbox
                   4588:             and start the upload:</p>
                   4589:             <pre class="screen">
1.14      xtraeme  4590: chroot-<code class="prompt">#</code> <strong class=
                   4591: "userinput"><code>exit</code></strong>        
                   4592: <code class="prompt">#</code> <strong class=
                   4593: "userinput"><code>cd /usr/sandbox/usr/pkgsrc</code></strong>        
                   4594: <code class="prompt">#</code> <strong class=
                   4595: "userinput"><code>sh mk/bulk/do-sandbox-upload</code></strong> 
1.13      hubertf  4596: </pre>
                   4597: 
                   4598:             <p>The upload process may take quite some time. Use
1.24      wiz      4599:             <a href=
                   4600:             "http://netbsd.gw.com/cgi-bin/man-cgi?ls+1+NetBSD-current">
                   4601:             <span class="citerefentry"><span class=
                   4602:             "refentrytitle">ls</span>(1)</span></a> or <a href=
                   4603:             "http://netbsd.gw.com/cgi-bin/man-cgi?du+1+NetBSD-current">
                   4604:             <span class="citerefentry"><span class=
                   4605:             "refentrytitle">du</span>(1)</span></a> on the FTP
                   4606:             server to monitor progress of the upload. The upload
                   4607:             script will take care of not uploading restricted
                   4608:             packages and putting vulnerable packages into the
1.45      wiz      4609:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4610:             class="filename">vulnerable</code> subdirectory.</p>
1.13      hubertf  4611: 
                   4612:             <p>After the upload has ended, first thing is to revoke
                   4613:             ssh access:</p>
                   4614:             <pre class="screen">
1.14      xtraeme  4615: nbftp% <strong class=
                   4616: "userinput"><code>vi ~/.ssh/authorized_keys</code></strong>
1.13      hubertf  4617: Gdd:x! 
                   4618: </pre>
                   4619: 
                   4620:             <p>Use whatever is needed to remove the key you've
                   4621:             entered before! Last, move the uploaded packages out of
1.45      wiz      4622:             the <code xmlns=
                   4623:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   4624:             "filename">upload</code> directory to have them
                   4625:             accessible to everyone:</p>
1.13      hubertf  4626:             <pre class="screen">
1.14      xtraeme  4627: nbftp% <strong class=
                   4628: "userinput"><code>cd /pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch</code></strong>
                   4629: nbftp% <strong class=
                   4630: "userinput"><code>mv upload/* .</code></strong>
                   4631: nbftp% <strong class="userinput"><code>rmdir upload</code></strong>
                   4632: nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> 
1.13      hubertf  4633: </pre>
                   4634:           </div>
1.1       grant    4635:         </div>
                   4636: 
1.52      tv       4637:         <div class="sect1" lang="en">
1.1       grant    4638:           <div class="titlepage">
                   4639:             <div>
                   4640:               <div>
                   4641:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    4642:                 "creating-cdroms"></a>6.4.&nbsp;Creating a multiple
1.30      wiz      4643:                 CD-ROM packages collection</h2>
1.1       grant    4644:               </div>
                   4645:             </div>
                   4646:           </div>
                   4647: 
                   4648:           <p>After your pkgsrc bulk-build has completed, you may
                   4649:           wish to create a CD-ROM set of the resulting binary
                   4650:           packages to assist in installing packages on other
                   4651:           machines. The <a xmlns=
                   4652:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   4653:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/cdpack/README.html"
1.45      wiz      4654:           target="_top"><code xmlns="" class=
                   4655:           "filename">pkgtools/cdpack</code></a> package provides a
1.20      ben      4656:           simple tool for creating the ISO 9660 images.
                   4657:           <span><strong class="command">cdpack</strong></span>
                   4658:           arranges the packages on the CD-ROMs in a way that keeps
1.47      reed     4659:           all the dependencies for a given package on the same CD
                   4660:           as that package.</p>
1.1       grant    4661: 
1.52      tv       4662:           <div class="sect2" lang="en">
1.1       grant    4663:             <div class="titlepage">
                   4664:               <div>
                   4665:                 <div>
1.52      tv       4666:                   <h3 class="title"><a name=
1.38      dillo    4667:                   "cdpack-example"></a>6.4.1.&nbsp;Example of
1.1       grant    4668:                   cdpack</h3>
                   4669:                 </div>
                   4670:               </div>
                   4671:             </div>
                   4672: 
                   4673:             <p>Complete documentation for cdpack is found in the
1.47      reed     4674:             cdpack(1) man page. The following short example assumes
1.45      wiz      4675:             that the binary packages are left in <code xmlns=
                   4676:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4677:             "filename">/usr/pkgsrc/packages/All</code> and that
1.45      wiz      4678:             sufficient disk space exists in <code xmlns=
                   4679:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4680:             "filename">/u2</code> to hold the ISO 9660 images.</p>
1.1       grant    4681:             <pre class="screen">
1.14      xtraeme  4682: <code class="prompt">#</code> <strong class=
                   4683: "userinput"><code>mkdir /u2/images</code></strong>
                   4684: <code class="prompt">#</code> <strong class=
                   4685: "userinput"><code>pkg_add /usr/pkgsrc/packages/All/cdpack</code></strong>
                   4686: <code class="prompt">#</code> <strong class=
                   4687: "userinput"><code>cdpack /usr/pkgsrc/packages/All /u2/images</code></strong>
1.1       grant    4688: </pre>
                   4689: 
                   4690:             <p>If you wish to include a common set of files
1.45      wiz      4691:             (<code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   4692:             class="filename">COPYRIGHT</code>, <code xmlns=
                   4693:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4694:             "filename">README</code>, etc.) on each CD in the
1.1       grant    4695:             collection, then you need to create a directory which
                   4696:             contains these files. e.g.</p>
                   4697:             <pre class="screen">
1.14      xtraeme  4698: <code class="prompt">#</code> <strong class=
                   4699: "userinput"><code>mkdir /tmp/common</code></strong>
                   4700: <code class="prompt">#</code> <strong class=
                   4701: "userinput"><code>echo "This is a README" &gt; /tmp/common/README</code></strong>
                   4702: <code class="prompt">#</code> <strong class=
                   4703: "userinput"><code>echo "Another file" &gt; /tmp/common/COPYING</code></strong>
                   4704: <code class="prompt">#</code> <strong class=
                   4705: "userinput"><code>mkdir /tmp/common/bin</code></strong>
                   4706: <code class="prompt">#</code> <strong class=
                   4707: "userinput"><code>echo "#!/bin/sh" &gt; /tmp/common/bin/myscript</code></strong>
                   4708: <code class="prompt">#</code> <strong class=
                   4709: "userinput"><code>echo "echo Hello world" &gt;&gt; /tmp/common/bin/myscript</code></strong>
                   4710: <code class="prompt">#</code> <strong class=
                   4711: "userinput"><code>chmod 755 /tmp/common/bin/myscript</code></strong>
1.1       grant    4712: </pre>
                   4713: 
                   4714:             <p>Now create the images:</p>
                   4715:             <pre class="screen">
1.14      xtraeme  4716: <code class="prompt">#</code> <strong class=
                   4717: "userinput"><code>cdpack -x /tmp/common /usr/pkgsrc/packages/All /u2/images</code></strong>
1.1       grant    4718: </pre>
                   4719: 
1.45      wiz      4720:             <p>Each image will contain <code xmlns=
                   4721:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   4722:             "filename">README</code>, <code xmlns=
                   4723:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   4724:             "filename">COPYING</code>, and <code xmlns=
                   4725:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4726:             "filename">bin/myscript</code> in their root
1.1       grant    4727:             directories.</p>
                   4728:           </div>
                   4729:         </div>
                   4730:       </div>
                   4731: 
1.52      tv       4732:       <div class="chapter" lang="en">
1.1       grant    4733:         <div class="titlepage">
                   4734:           <div>
                   4735:             <div>
1.52      tv       4736:               <h2 class="title"><a name=
1.38      dillo    4737:               "faq"></a>Chapter&nbsp;7.&nbsp;Frequently Asked
1.1       grant    4738:               Questions</h2>
                   4739:             </div>
                   4740:           </div>
                   4741:         </div>
                   4742: 
                   4743:         <div class="toc">
                   4744:           <p><b>Table of Contents</b></p>
                   4745: 
                   4746:           <dl>
1.30      wiz      4747:             <dt><span class="sect1"><a href=
1.38      dillo    4748:             "#mailing-list-pointers">7.1. Are there any mailing
1.30      wiz      4749:             lists for pkg-related discussion?</a></span></dt>
1.1       grant    4750: 
1.38      dillo    4751:             <dt><span class="sect1"><a href="#pkgviews-docs">7.2.
1.1       grant    4752:             Where's the pkgviews documentation?</a></span></dt>
                   4753: 
1.38      dillo    4754:             <dt><span class="sect1"><a href="#faq-pkgtools">7.3.
1.1       grant    4755:             Utilities for package management
                   4756:             (pkgtools)</a></span></dt>
                   4757: 
1.38      dillo    4758:             <dt><span class="sect1"><a href="#non-root-pkgsrc">7.4.
1.30      wiz      4759:             How to use pkgsrc as non-root</a></span></dt>
1.1       grant    4760: 
1.30      wiz      4761:             <dt><span class="sect1"><a href=
1.38      dillo    4762:             "#resume-transfers">7.5. How to resume transfers when
1.30      wiz      4763:             fetching distfiles?</a></span></dt>
1.14      xtraeme  4764: 
1.30      wiz      4765:             <dt><span class="sect1"><a href=
1.38      dillo    4766:             "#XFree86-from-pkgsrc">7.6. How can I install/use
1.30      wiz      4767:             XFree86 from pkgsrc?</a></span></dt>
1.1       grant    4768: 
1.30      wiz      4769:             <dt><span class="sect1"><a href=
1.38      dillo    4770:             "#x.org-from-pkgsrc">7.7. How can I install/use X.org
1.30      wiz      4771:             from pkgsrc?</a></span></dt>
1.1       grant    4772: 
1.30      wiz      4773:             <dt><span class="sect1"><a href=
1.38      dillo    4774:             "#fetch-behind-firewall">7.8. How to fetch files from
1.30      wiz      4775:             behind a firewall</a></span></dt>
1.1       grant    4776: 
1.38      dillo    4777:             <dt><span class="sect1"><a href="#passive-ftp">7.9. How
1.14      xtraeme  4778:             do I tell <span><strong class="command">make
                   4779:             fetch</strong></span> to do passive
                   4780:             FTP?</a></span></dt>
1.1       grant    4781: 
1.30      wiz      4782:             <dt><span class="sect1"><a href=
1.38      dillo    4783:             "#fetching-all-distfiles">7.10. How to fetch all
1.30      wiz      4784:             distfiles at once</a></span></dt>
1.1       grant    4785: 
1.30      wiz      4786:             <dt><span class="sect1"><a href=
1.38      dillo    4787:             "#tmac.andoc-missing">7.11. What does
1.30      wiz      4788:             &#8220;<span class="quote">Don't know how to make
1.14      xtraeme  4789:             /usr/share/tmac/tmac.andoc</span>&#8221;
1.1       grant    4790:             mean?</a></span></dt>
                   4791: 
1.30      wiz      4792:             <dt><span class="sect1"><a href=
1.38      dillo    4793:             "#bsd.own.mk-missing">7.12. What does
1.30      wiz      4794:             &#8220;<span class="quote">Could not find
1.14      xtraeme  4795:             bsd.own.mk</span>&#8221; mean?</a></span></dt>
1.1       grant    4796: 
1.30      wiz      4797:             <dt><span class="sect1"><a href=
1.38      dillo    4798:             "#using-sudo-with-pkgsrc">7.13. Using 'sudo' with
1.30      wiz      4799:             pkgsrc</a></span></dt>
1.1       grant    4800: 
1.38      dillo    4801:             <dt><span class="sect1"><a href="#faq.conf">7.14. How
1.35      jmmv     4802:             do I change the location of configuration
                   4803:             files?</a></span></dt>
1.1       grant    4804: 
1.38      dillo    4805:             <dt><span class="sect1"><a href="#audit-packages">7.15.
1.1       grant    4806:             Automated security checks</a></span></dt>
                   4807:           </dl>
                   4808:         </div>
                   4809: 
                   4810:         <p>This section contains hints, tips &amp; tricks on
                   4811:         special things in pkgsrc that we didn't find a better place
                   4812:         for in the previous chapters, and it contains items for
                   4813:         both pkgsrc users and developers.</p>
                   4814: 
1.52      tv       4815:         <div class="sect1" lang="en">
1.1       grant    4816:           <div class="titlepage">
                   4817:             <div>
                   4818:               <div>
                   4819:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    4820:                 "mailing-list-pointers"></a>7.1.&nbsp;Are there any
1.30      wiz      4821:                 mailing lists for pkg-related discussion?</h2>
1.1       grant    4822:               </div>
                   4823:             </div>
                   4824:           </div>
                   4825: 
1.18      xtraeme  4826:           <p>The following mailing lists may be of interest to
                   4827:           pkgsrc users:</p>
                   4828: 
                   4829:           <div class="itemizedlist">
                   4830:             <ul type="disc">
                   4831:               <li>
                   4832:                 <p><a href=
                   4833:                 "http://www.NetBSD.org/MailingLists/index.html#pkgsrc-bugs"
1.34      wiz      4834:                 target="_top">pkgsrc-bugs</a>: A list where problem
                   4835:                 reports related to pkgsrc are sent and
                   4836:                 discussed.</p>
1.18      xtraeme  4837:               </li>
                   4838: 
                   4839:               <li>
                   4840:                 <p><a href=
                   4841:                 "http://www.NetBSD.org/MailingLists/index.html#pkgsrc-bulk"
1.34      wiz      4842:                 target="_top">pkgsrc-bulk</a>: A list where the
1.20      ben      4843:                 results of pkgsrc bulk builds are sent and
1.34      wiz      4844:                 discussed.</p>
1.18      xtraeme  4845:               </li>
                   4846: 
                   4847:               <li>
                   4848:                 <p><a href=
                   4849:                 "http://www.NetBSD.org/MailingLists/index.html#pkgsrc-changes"
1.34      wiz      4850:                 target="_top">pkgsrc-changes</a>: A list where all
                   4851:                 commit messages to pkgsrc are sent.</p>
1.18      xtraeme  4852:               </li>
                   4853: 
                   4854:               <li>
                   4855:                 <p><a href=
                   4856:                 "http://www.NetBSD.org/MailingLists/index.html#tech-pkg"
1.34      wiz      4857:                 target="_top">tech-pkg</a>: A general discussion
                   4858:                 list for all things related to pkgsrc.</p>
1.18      xtraeme  4859:               </li>
                   4860:             </ul>
                   4861:           </div>
                   4862: 
                   4863:           <p>To subscribe, do:</p>
1.1       grant    4864:           <pre class="programlisting">
1.51      rillig   4865:     <code class="prompt">%</code> echo subscribe <em class=
1.18      xtraeme  4866: "replaceable"><code>listname</code></em> | mail majordomo@NetBSD.org
1.1       grant    4867: </pre>
                   4868: 
1.18      xtraeme  4869:           <p>Archives for all these mailing lists are available
                   4870:           from <a href="http://mail-index.NetBSD.org/" target=
                   4871:           "_top">http://mail-index.NetBSD.org/</a>.</p>
1.1       grant    4872:         </div>
                   4873: 
1.52      tv       4874:         <div class="sect1" lang="en">
1.1       grant    4875:           <div class="titlepage">
                   4876:             <div>
                   4877:               <div>
                   4878:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    4879:                 "pkgviews-docs"></a>7.2.&nbsp;Where's the pkgviews
1.30      wiz      4880:                 documentation?</h2>
1.1       grant    4881:               </div>
                   4882:             </div>
                   4883:           </div>
                   4884: 
                   4885:           <p>Pkgviews is tightly integrated with buildlink. You can
1.45      wiz      4886:           find a pkgviews User's guide in <code xmlns=
                   4887:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  4888:           "filename">pkgsrc/mk/buildlink3/PKGVIEWS_UG</code>.</p>
1.1       grant    4889:         </div>
                   4890: 
1.52      tv       4891:         <div class="sect1" lang="en">
1.1       grant    4892:           <div class="titlepage">
                   4893:             <div>
                   4894:               <div>
                   4895:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    4896:                 "faq-pkgtools"></a>7.3.&nbsp;Utilities for package
1.5       hubertf  4897:                 management (pkgtools)</h2>
1.1       grant    4898:               </div>
                   4899:             </div>
                   4900:           </div>
                   4901: 
1.45      wiz      4902:           <p>The <code xmlns=
                   4903:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   4904:           "filename">pkgsrc/pkgtools</code> directory pkgtools
                   4905:           contains a number of useful utilities for both users and
                   4906:           developers of pkgsrc. This section attempts only to make
                   4907:           the reader aware of the utilities and when they might be
                   4908:           useful, and not to duplicate the documentation that comes
                   4909:           with each package.</p>
1.1       grant    4910: 
                   4911:           <p>Utilities used by pkgsrc (automatically installed when
                   4912:           needed):</p>
                   4913: 
                   4914:           <div class="itemizedlist">
                   4915:             <ul type="disc">
                   4916:               <li>
                   4917:                 <p><a xmlns=
                   4918:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   4919:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/x11-links/README.html"
1.45      wiz      4920:                 target="_top"><code xmlns="" class=
                   4921:                 "filename">pkgtools/x11-links</code></a>: Symlinks
1.34      wiz      4922:                 for use by buildlink.</p>
1.1       grant    4923:               </li>
                   4924:             </ul>
                   4925:           </div>
                   4926: 
                   4927:           <p>OS tool augmentation (automatically installed when
                   4928:           needed):</p>
                   4929: 
                   4930:           <div class="itemizedlist">
                   4931:             <ul type="disc">
                   4932:               <li>
                   4933:                 <p><a xmlns=
                   4934:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   4935:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/digest/README.html"
1.45      wiz      4936:                 target="_top"><code xmlns="" class=
                   4937:                 "filename">pkgtools/digest</code></a>: Calculates
1.34      wiz      4938:                 various kinds of checksums (including SHA1).</p>
1.1       grant    4939:               </li>
                   4940: 
                   4941:               <li>
                   4942:                 <p><a xmlns=
                   4943:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   4944:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/libnbcompat/README.html"
1.45      wiz      4945:                 target="_top"><code xmlns="" class=
                   4946:                 "filename">pkgtools/libnbcompat</code></a>:
1.34      wiz      4947:                 Compatibility library for pkgsrc tools.</p>
1.1       grant    4948:               </li>
                   4949: 
                   4950:               <li>
                   4951:                 <p><a xmlns=
                   4952:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   4953:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/mtree/README.html"
1.45      wiz      4954:                 target="_top"><code xmlns="" class=
                   4955:                 "filename">pkgtools/mtree</code></a>: Installed on
1.34      wiz      4956:                 non-BSD systems due to lack of native mtree.</p>
1.1       grant    4957:               </li>
                   4958: 
                   4959:               <li>
                   4960:                 <p><a xmlns=
                   4961:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   4962:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_install/README.html"
1.45      wiz      4963:                 target="_top"><code xmlns="" class=
                   4964:                 "filename">pkgtools/pkg_install</code></a>:
                   4965:                 Up-to-date replacement for <code xmlns=
                   4966:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.34      wiz      4967:                 "filename">/usr/sbin/pkg_install</code>, or for use
                   4968:                 on operating systems where pkg_install is not
                   4969:                 present.</p>
1.1       grant    4970:               </li>
                   4971:             </ul>
                   4972:           </div>
                   4973: 
                   4974:           <p>Utilities used by pkgsrc (not automatically
                   4975:           installed):</p>
                   4976: 
                   4977:           <div class="itemizedlist">
                   4978:             <ul type="disc">
                   4979:               <li>
                   4980:                 <p><a xmlns=
                   4981:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   4982:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_tarup/README.html"
1.45      wiz      4983:                 target="_top"><code xmlns="" class=
                   4984:                 "filename">pkgtools/pkg_tarup</code></a>: Create a
1.20      ben      4985:                 binary package from an already-installed package.
1.34      wiz      4986:                 Used by <span><strong class="command">make
                   4987:                 replace</strong></span> to save the old
                   4988:                 package.</p>
1.1       grant    4989:               </li>
                   4990: 
                   4991:               <li>
                   4992:                 <p><a xmlns=
                   4993:                 "http://www.w3.org/TR/xhtml1/transitional" href=
1.5       hubertf  4994:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/dfdisk/README.html"
1.45      wiz      4995:                 target="_top"><code xmlns="" class=
                   4996:                 "filename">pkgtools/dfdisk</code></a>: Adds extra
1.20      ben      4997:                 functionality to pkgsrc, allowing it to fetch
                   4998:                 distfiles from multiple locations. It currently
                   4999:                 supports the following methods: multiple CD-ROMs
                   5000:                 and network FTP/HTTP connections.</p>
1.5       hubertf  5001:               </li>
                   5002: 
                   5003:               <li>
                   5004:                 <p><a xmlns=
                   5005:                 "http://www.w3.org/TR/xhtml1/transitional" href=
1.1       grant    5006:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/xpkgwedge/README.html"
1.45      wiz      5007:                 target="_top"><code xmlns="" class=
                   5008:                 "filename">pkgtools/xpkgwedge</code></a>: Put X11
1.34      wiz      5009:                 packages someplace else (enabled by default).</p>
1.1       grant    5010:               </li>
1.5       hubertf  5011: 
                   5012:               <li>
                   5013:                 <p><a xmlns=
                   5014:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5015:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/cpuflags/README.html"
1.45      wiz      5016:                 target="_top"><code xmlns="" class=
                   5017:                 "filename">devel/cpuflags</code></a>: Determine the
1.34      wiz      5018:                 best compiler flags to optimise code for your
1.20      ben      5019:                 current CPU and compiler.</p>
1.5       hubertf  5020:               </li>
1.1       grant    5021:             </ul>
                   5022:           </div>
                   5023: 
                   5024:           <p>Utilities for keeping track of installed packages,
                   5025:           being up to date, etc:</p>
                   5026: 
                   5027:           <div class="itemizedlist">
                   5028:             <ul type="disc">
                   5029:               <li>
                   5030:                 <p><a xmlns=
                   5031:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5032:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_chk/README.html"
1.45      wiz      5033:                 target="_top"><code xmlns="" class=
                   5034:                 "filename">pkgtools/pkg_chk</code></a>: Reports on
1.27      rillig   5035:                 packages whose installed versions do not match the
1.34      wiz      5036:                 latest pkgsrc entries.</p>
1.1       grant    5037:               </li>
                   5038: 
                   5039:               <li>
                   5040:                 <p><a xmlns=
                   5041:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5042:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdep/README.html"
1.45      wiz      5043:                 target="_top"><code xmlns="" class=
                   5044:                 "filename">pkgtools/pkgdep</code></a>: Makes
1.20      ben      5045:                 dependency graphs of packages, to aid in choosing a
1.34      wiz      5046:                 strategy for updating.</p>
1.1       grant    5047:               </li>
                   5048: 
                   5049:               <li>
                   5050:                 <p><a xmlns=
                   5051:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5052:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdepgraph/README.html"
1.45      wiz      5053:                 target="_top"><code xmlns="" class=
                   5054:                 "filename">pkgtools/pkgdepgraph</code></a>: Makes
1.27      rillig   5055:                 graphs from the output of <a xmlns=
                   5056:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5057:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdep/README.html"
1.45      wiz      5058:                 target="_top"><code xmlns="" class=
                   5059:                 "filename">pkgtools/pkgdep</code></a> (uses
1.34      wiz      5060:                 graphviz).</p>
1.1       grant    5061:               </li>
                   5062: 
                   5063:               <li>
                   5064:                 <p><a xmlns=
                   5065:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5066:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkglint/README.html"
1.45      wiz      5067:                 target="_top"><code xmlns="" class=
                   5068:                 "filename">pkgtools/pkglint</code></a>: The
1.27      rillig   5069:                 pkglint(1) program checks a pkgsrc entry for
                   5070:                 errors, lintpkgsrc(1) does various checks on the
                   5071:                 complete pkgsrc system.</p>
1.1       grant    5072:               </li>
                   5073: 
                   5074:               <li>
                   5075:                 <p><a xmlns=
                   5076:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5077:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgsurvey/README.html"
1.45      wiz      5078:                 target="_top"><code xmlns="" class=
                   5079:                 "filename">pkgtools/pkgsurvey</code></a>: Report
                   5080:                 what packages you have installed.</p>
1.1       grant    5081:               </li>
                   5082:             </ul>
                   5083:           </div>
                   5084: 
                   5085:           <p>Utilities for people maintaining or creating
                   5086:           individual packages:</p>
                   5087: 
                   5088:           <div class="itemizedlist">
                   5089:             <ul type="disc">
                   5090:               <li>
                   5091:                 <p><a xmlns=
                   5092:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5093:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdiff/README.html"
1.45      wiz      5094:                 target="_top"><code xmlns="" class=
                   5095:                 "filename">pkgtools/pkgdiff</code></a>: Automate
1.20      ben      5096:                 making and maintaining patches for a package
1.34      wiz      5097:                 (includes pkgdiff, pkgvi, mkpatches, etc.).</p>
1.1       grant    5098:               </li>
                   5099: 
                   5100:               <li>
                   5101:                 <p><a xmlns=
                   5102:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5103:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/rpm2pkg/README.html"
1.45      wiz      5104:                 target="_top"><code xmlns="" class=
                   5105:                 "filename">pkgtools/rpm2pkg</code></a>, <a xmlns=
1.20      ben      5106:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5107:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/url2pkg/README.html"
1.45      wiz      5108:                 target="_top"><code xmlns="" class=
                   5109:                 "filename">pkgtools/url2pkg</code></a>: Aids in
1.34      wiz      5110:                 converting to pkgsrc.</p>
1.1       grant    5111:               </li>
                   5112: 
                   5113:               <li>
                   5114:                 <p><a xmlns=
                   5115:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5116:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/gensolpkg/README.html"
1.45      wiz      5117:                 target="_top"><code xmlns="" class=
                   5118:                 "filename">pkgtools/gensolpkg</code></a>: Convert
1.34      wiz      5119:                 pkgsrc to a Solaris package.</p>
1.1       grant    5120:               </li>
                   5121:             </ul>
                   5122:           </div>
                   5123: 
1.47      reed     5124:           <p>Utilities for people maintaining pkgsrc (or: more
1.1       grant    5125:           obscure pkg utilities)</p>
                   5126: 
                   5127:           <div class="itemizedlist">
                   5128:             <ul type="disc">
                   5129:               <li>
                   5130:                 <p><a xmlns=
                   5131:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5132:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_comp/README.html"
1.45      wiz      5133:                 target="_top"><code xmlns="" class=
                   5134:                 "filename">pkgtools/pkg_comp</code></a>: Build
1.34      wiz      5135:                 packages in a chrooted area.</p>
1.1       grant    5136:               </li>
                   5137: 
                   5138:               <li>
                   5139:                 <p><a xmlns=
                   5140:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   5141:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/libkver/README.html"
1.45      wiz      5142:                 target="_top"><code xmlns="" class=
                   5143:                 "filename">pkgtools/libkver</code></a>: Spoof
                   5144:                 kernel version for chrooted cross builds.</p>
1.1       grant    5145:               </li>
                   5146:             </ul>
                   5147:           </div>
                   5148:         </div>
                   5149: 
1.52      tv       5150:         <div class="sect1" lang="en">
1.1       grant    5151:           <div class="titlepage">
                   5152:             <div>
                   5153:               <div>
                   5154:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    5155:                 "non-root-pkgsrc"></a>7.4.&nbsp;How to use pkgsrc
1.30      wiz      5156:                 as non-root</h2>
1.1       grant    5157:               </div>
                   5158:             </div>
                   5159:           </div>
                   5160: 
                   5161:           <p>If you want to use pkgsrc as non-root user, you can
                   5162:           set some variables to make pkgsrc work under these
1.33      jmmv     5163:           conditions. At the very least, you need to set
                   5164:           <code class="varname">UNPRIVILEGED</code> to
                   5165:           &#8220;<span class="quote">yes</span>&#8221;; this will
                   5166:           turn on unprivileged mode and set multiple related
                   5167:           variables to allow installation of packages as
                   5168:           non-root.</p>
                   5169: 
                   5170:           <p>In case the defaults are not enough, you may want to
                   5171:           tune some other variables used. For example, if the
                   5172:           automatic user/group detection leads to incorrect values
                   5173:           (or not the ones you would like to use), you can change
                   5174:           them by setting <code class=
                   5175:           "varname">UNPRIVILEGED_USER</code> and <code class=
                   5176:           "varname">UNPRIVILEGED_GROUP</code> respectively.</p>
                   5177: 
                   5178:           <p>As regards bootstrapping, please note that the
                   5179:           <span><strong class="command">bootstrap</strong></span>
                   5180:           script will ease non-root configuration when given the
                   5181:           &#8220;<span class=
                   5182:           "quote">--ignore-user-check</span>&#8221; flag, as it
                   5183:           will choose and use multiple default directories under
1.45      wiz      5184:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   5185:           class="filename">~/pkg</code> as the installation
1.33      jmmv     5186:           targets. These directories can be overriden by the
                   5187:           &#8220;<span class="quote">--prefix</span>&#8221; flag
                   5188:           provided by the script, as well as some others that allow
                   5189:           finer tuning of the tree layout.</p>
1.14      xtraeme  5190:         </div>
                   5191: 
1.52      tv       5192:         <div class="sect1" lang="en">
1.14      xtraeme  5193:           <div class="titlepage">
                   5194:             <div>
                   5195:               <div>
                   5196:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    5197:                 "resume-transfers"></a>7.5.&nbsp;How to resume
1.30      wiz      5198:                 transfers when fetching distfiles?</h2>
1.14      xtraeme  5199:               </div>
                   5200:             </div>
                   5201:           </div>
                   5202: 
1.47      reed     5203:           <p>By default, resuming transfers in pkgsrc is disabled,
1.15      xtraeme  5204:           but you can enable this feature by adding the option
                   5205:           <code class="varname">PKG_RESUME_TRANSFERS=YES</code>
1.45      wiz      5206:           into <code xmlns=
                   5207:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   5208:           "filename">/etc/mk.conf</code>. If, during a fetch step,
                   5209:           an incomplete distfile is found, pkgsrc will try to
                   5210:           resume it.</p>
1.15      xtraeme  5211: 
                   5212:           <p>You can also use a different program than the default
1.24      wiz      5213:           <a href=
                   5214:           "http://netbsd.gw.com/cgi-bin/man-cgi?ftp+1+NetBSD-current">
                   5215:           <span class="citerefentry"><span class=
                   5216:           "refentrytitle">ftp</span>(1)</span></a> by changing the
                   5217:           <code class="varname">FETCH_CMD</code> variable. Don't
                   5218:           forget to set <code class=
                   5219:           "varname">FETCH_RESUME_ARGS</code> and <code class=
                   5220:           "varname">FETCH_OUTPUT_ARGS</code> if you are not using
                   5221:           default values.</p>
1.14      xtraeme  5222: 
1.45      wiz      5223:           <p>For example, if you want to use <code xmlns=
                   5224:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  5225:           "filename">wget</code> to resume downloads, you'll have
                   5226:           to use something like:</p>
                   5227:           <pre class="programlisting">
1.51      rillig   5228:     FETCH_CMD=             wget
                   5229:     FETCH_BEFORE_ARGS=     --passive-ftp
                   5230:     FETCH_RESUME_ARGS=     -c
                   5231:     FETCH_OUTPUT_ARGS=     -O
1.14      xtraeme  5232: </pre>
1.1       grant    5233:         </div>
                   5234: 
1.52      tv       5235:         <div class="sect1" lang="en">
1.1       grant    5236:           <div class="titlepage">
                   5237:             <div>
                   5238:               <div>
                   5239:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    5240:                 "XFree86-from-pkgsrc"></a>7.6.&nbsp;How can I
1.1       grant    5241:                 install/use XFree86 from pkgsrc?</h2>
                   5242:               </div>
                   5243:             </div>
                   5244:           </div>
                   5245: 
                   5246:           <p>If you want to use XFree86 from pkgsrc instead of your
1.45      wiz      5247:           system's own X11 (<code xmlns=
                   5248:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   5249:           "filename">/usr/X11R6</code>, <code xmlns=
                   5250:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  5251:           "filename">/usr/openwin</code>, ...), you will have to
1.45      wiz      5252:           add the following line into <code xmlns=
                   5253:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.15      xtraeme  5254:           "filename">/etc/mk.conf</code>:</p>
1.1       grant    5255:           <pre class="programlisting">
1.51      rillig   5256:     X11_TYPE=XFree86
1.1       grant    5257: </pre>
                   5258:         </div>
                   5259: 
1.52      tv       5260:         <div class="sect1" lang="en">
1.1       grant    5261:           <div class="titlepage">
                   5262:             <div>
                   5263:               <div>
                   5264:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    5265:                 "x.org-from-pkgsrc"></a>7.7.&nbsp;How can I
1.1       grant    5266:                 install/use X.org from pkgsrc?</h2>
                   5267:               </div>
                   5268:             </div>
                   5269:           </div>
                   5270: 
                   5271:           <p>If you want to use X.org from pkgsrc instead of your
1.45      wiz      5272:           system's own X11 (<code xmlns=
                   5273:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   5274:           "filename">/usr/X11R6</code>, <code xmlns=
                   5275:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  5276:           "filename">/usr/openwin</code>, ...) you will have to add
1.45      wiz      5277:           the following line into <code xmlns=
                   5278:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.15      xtraeme  5279:           "filename">/etc/mk.conf</code>:</p>
1.1       grant    5280:           <pre class="programlisting">
1.51      rillig   5281:     X11_TYPE=xorg
1.1       grant    5282: </pre>
                   5283:         </div>
                   5284: 
1.52      tv       5285:         <div class="sect1" lang="en">
1.1       grant    5286:           <div class="titlepage">
                   5287:             <div>
                   5288:               <div>
                   5289:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    5290:                 "fetch-behind-firewall"></a>7.8.&nbsp;How to fetch
1.30      wiz      5291:                 files from behind a firewall</h2>
1.1       grant    5292:               </div>
                   5293:             </div>
                   5294:           </div>
                   5295: 
                   5296:           <p>If you are sitting behind a firewall which does not
                   5297:           allow direct connections to Internet hosts (i.e.
                   5298:           non-NAT), you may specify the relevant proxy hosts. This
                   5299:           is done using an environment variable in the form of a
1.47      reed     5300:           URL, e.g. in Amdahl, the machine &#8220;<span class=
1.1       grant    5301:           "quote">orpheus.amdahl.com</span>&#8221; is one of the
                   5302:           firewalls, and it uses port 80 as the proxy port number.
                   5303:           So the proxy environment variables are:</p>
                   5304:           <pre class="programlisting">
1.51      rillig   5305:     ftp_proxy=ftp://orpheus.amdahl.com:80/
                   5306:     http_proxy=http://orpheus.amdahl.com:80/
1.1       grant    5307: </pre>
                   5308:         </div>
                   5309: 
1.52      tv       5310:         <div class="sect1" lang="en">
1.1       grant    5311:           <div class="titlepage">
                   5312:             <div>
                   5313:               <div>
                   5314:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       5315:                 "passive-ftp"></a>7.9.&nbsp;How do I tell
                   5316:                 <span><strong class="command">make
1.14      xtraeme  5317:                 fetch</strong></span> to do passive FTP?</h2>
1.1       grant    5318:               </div>
                   5319:             </div>
                   5320:           </div>
                   5321: 
                   5322:           <p>This depends on which utility is used to retrieve
1.45      wiz      5323:           distfiles. From <code xmlns=
                   5324:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   5325:           "filename">bsd.pkg.mk</code>, <code class=
                   5326:           "varname">FETCH_CMD</code> is assigned the first
                   5327:           available command from the following list:</p>
1.34      wiz      5328: 
                   5329:           <div class="itemizedlist">
                   5330:             <ul type="disc">
                   5331:               <li>
1.45      wiz      5332:                 <p><code xmlns=
                   5333:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.34      wiz      5334:                 "filename">${LOCALBASE}/bin/ftp</code></p>
                   5335:               </li>
                   5336: 
                   5337:               <li>
1.45      wiz      5338:                 <p><code xmlns=
                   5339:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   5340:                 "filename">/usr/bin/ftp</code></p>
1.34      wiz      5341:               </li>
                   5342:             </ul>
                   5343:           </div>
1.1       grant    5344: 
                   5345:           <p>On a default NetBSD installation, this will be
1.45      wiz      5346:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   5347:           class="filename">/usr/bin/ftp</code>, which automatically
                   5348:           tries passive connections first, and falls back to active
                   5349:           connections if the server refuses to do passive. For the
                   5350:           other tools, add the following to your <code xmlns=
                   5351:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   5352:           "filename">/etc/mk.conf</code> file: <code class=
                   5353:           "varname">PASSIVE_FETCH=1</code>.</p>
1.1       grant    5354: 
1.45      wiz      5355:           <p>Having that option present will prevent <code xmlns=
                   5356:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  5357:           "filename">/usr/bin/ftp</code> from falling back to
                   5358:           active transfers.</p>
1.1       grant    5359:         </div>
                   5360: 
1.52      tv       5361:         <div class="sect1" lang="en">
1.1       grant    5362:           <div class="titlepage">
                   5363:             <div>
                   5364:               <div>
                   5365:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    5366:                 "fetching-all-distfiles"></a>7.10.&nbsp;How to
1.1       grant    5367:                 fetch all distfiles at once</h2>
                   5368:               </div>
                   5369:             </div>
                   5370:           </div>
                   5371: 
                   5372:           <p>You would like to download all the distfiles in a
                   5373:           single batch from work or university, where you can't run
1.14      xtraeme  5374:           a <span><strong class="command">make
                   5375:           fetch</strong></span>. There is an archive of distfiles
                   5376:           on <a href=
1.1       grant    5377:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/"
                   5378:           target="_top">ftp.NetBSD.org</a>, but downloading the
                   5379:           entire directory may not be appropriate.</p>
                   5380: 
1.14      xtraeme  5381:           <p>The answer here is to do a <span><strong class=
1.45      wiz      5382:           "command">make fetch-list</strong></span> in <code xmlns=
                   5383:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.47      reed     5384:           "filename">/usr/pkgsrc</code> or one of its
1.1       grant    5385:           subdirectories, carry the resulting list to your machine
1.23      wiz      5386:           at work/school and use it there. If you don't have a
1.24      wiz      5387:           NetBSD-compatible <a href=
                   5388:           "http://netbsd.gw.com/cgi-bin/man-cgi?ftp+1+NetBSD-current">
                   5389:           <span class="citerefentry"><span class=
                   5390:           "refentrytitle">ftp</span>(1)</span></a> (like lukemftp)
                   5391:           at work, don't forget to set <code class=
                   5392:           "varname">FETCH_CMD</code> to something that fetches a
                   5393:           URL:</p>
1.1       grant    5394: 
                   5395:           <p>At home:</p>
                   5396:           <pre class="screen">
1.14      xtraeme  5397: <code class="prompt">%</code> <strong class=
                   5398: "userinput"><code>cd /usr/pkgsrc</code></strong>
                   5399: <code class="prompt">%</code> <strong class=
                   5400: "userinput"><code>make fetch-list FETCH_CMD=wget DISTDIR=/tmp/distfiles &gt;/tmp/fetch.sh</code></strong>
                   5401: <code class="prompt">%</code> <strong class=
                   5402: "userinput"><code>scp /tmp/fetch.sh work:/tmp</code></strong>
1.1       grant    5403: </pre>
                   5404: 
                   5405:           <p>At work:</p>
                   5406:           <pre class="screen">
1.14      xtraeme  5407: <code class="prompt">%</code> <strong class=
                   5408: "userinput"><code>sh /tmp/fetch.sh</code></strong>
1.1       grant    5409: </pre>
                   5410: 
1.45      wiz      5411:           <p>then tar up <code xmlns=
                   5412:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  5413:           "filename">/tmp/distfiles</code> and take it home.</p>
1.1       grant    5414: 
                   5415:           <p>If you have a machine running NetBSD, and you want to
                   5416:           get <span class="emphasis"><em>all</em></span> distfiles
                   5417:           (even ones that aren't for your machine architecture),
                   5418:           you can do so by using the above-mentioned
1.14      xtraeme  5419:           <span><strong class="command">make
                   5420:           fetch-list</strong></span> approach, or fetch the
                   5421:           distfiles directly by running:</p>
1.1       grant    5422:           <pre class="screen">
1.14      xtraeme  5423: <code class="prompt">%</code> <strong class=
                   5424: "userinput"><code>make mirror-distfiles</code></strong>
1.1       grant    5425: </pre>
                   5426: 
1.14      xtraeme  5427:           <p>If you even decide to ignore <code class=
                   5428:           "varname">NO_{SRC,BIN}_ON_{FTP,CDROM}</code>, then you
                   5429:           can get everything by running:</p>
1.1       grant    5430:           <pre class="screen">
1.14      xtraeme  5431: <code class="prompt">%</code> <strong class=
                   5432: "userinput"><code>make fetch NO_SKIP=yes</code></strong>
1.1       grant    5433: </pre>
                   5434:         </div>
                   5435: 
1.52      tv       5436:         <div class="sect1" lang="en">
1.1       grant    5437:           <div class="titlepage">
                   5438:             <div>
                   5439:               <div>
                   5440:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    5441:                 "tmac.andoc-missing"></a>7.11.&nbsp;What does
1.1       grant    5442:                 &#8220;<span class="quote">Don't know how to make
                   5443:                 /usr/share/tmac/tmac.andoc</span>&#8221; mean?</h2>
                   5444:               </div>
                   5445:             </div>
                   5446:           </div>
                   5447: 
                   5448:           <p>When compiling the <a xmlns=
                   5449:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   5450:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_install/README.html"
1.45      wiz      5451:           target="_top"><code xmlns="" class=
                   5452:           "filename">pkgtools/pkg_install</code></a> package, you
                   5453:           get the error from make that it doesn't know how to make
                   5454:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   5455:           class="filename">/usr/share/tmac/tmac.andoc</code>? This
                   5456:           indicates that you don't have installed the
1.23      wiz      5457:           &#8220;<span class="quote">text</span>&#8221; set (nroff,
                   5458:           ...) from the NetBSD base distribution on your machine.
1.47      reed     5459:           It is recommended to do that to format man pages.</p>
1.1       grant    5460: 
                   5461:           <p>In the case of the <a xmlns=
                   5462:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   5463:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_install/README.html"
1.45      wiz      5464:           target="_top"><code xmlns="" class=
                   5465:           "filename">pkgtools/pkg_install</code></a> package, you
                   5466:           can get away with setting <code class=
1.20      ben      5467:           "varname">NOMAN=YES</code> either in the environment or
1.45      wiz      5468:           in <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   5469:           class="filename">/etc/mk.conf</code>.</p>
1.1       grant    5470:         </div>
                   5471: 
1.52      tv       5472:         <div class="sect1" lang="en">
1.1       grant    5473:           <div class="titlepage">
                   5474:             <div>
                   5475:               <div>
                   5476:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    5477:                 "bsd.own.mk-missing"></a>7.12.&nbsp;What does
1.1       grant    5478:                 &#8220;<span class="quote">Could not find
                   5479:                 bsd.own.mk</span>&#8221; mean?</h2>
                   5480:               </div>
                   5481:             </div>
                   5482:           </div>
                   5483: 
1.45      wiz      5484:           <p>You didn't install the compiler set, <code xmlns=
                   5485:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  5486:           "filename">comp.tgz</code>, when you installed your
1.47      reed     5487:           NetBSD machine. Please get and install it, by extracting
                   5488:           it in <code xmlns=
1.45      wiz      5489:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   5490:           "filename">/</code>:</p>
1.1       grant    5491:           <pre class="screen">
1.14      xtraeme  5492: <code class="prompt">#</code> <strong class=
                   5493: "userinput"><code>cd /</code></strong>
                   5494: <code class="prompt">#</code> <strong class=
                   5495: "userinput"><code>tar --unlink -zxvpf .../comp.tgz</code></strong>
1.1       grant    5496: </pre>
                   5497: 
1.45      wiz      5498:           <p><code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   5499:           class="filename">comp.tgz</code> is part of every NetBSD
                   5500:           release. Get the one that corresponds to your release
                   5501:           (determine via <span><strong class="command">uname
                   5502:           -r</strong></span>).</p>
1.1       grant    5503:         </div>
                   5504: 
1.52      tv       5505:         <div class="sect1" lang="en">
1.1       grant    5506:           <div class="titlepage">
                   5507:             <div>
                   5508:               <div>
                   5509:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    5510:                 "using-sudo-with-pkgsrc"></a>7.13.&nbsp;Using
1.1       grant    5511:                 'sudo' with pkgsrc</h2>
                   5512:               </div>
                   5513:             </div>
                   5514:           </div>
                   5515: 
                   5516:           <p>When installing packages as non-root user and using
1.24      wiz      5517:           the just-in-time <a href=
                   5518:           "http://netbsd.gw.com/cgi-bin/man-cgi?su+1+NetBSD-current">
                   5519:           <span class="citerefentry"><span class=
                   5520:           "refentrytitle">su</span>(1)</span></a> feature of
                   5521:           pkgsrc, it can become annoying to type in the root
                   5522:           password for each required package installed. To avoid
                   5523:           this, the sudo package can be used, which does password
                   5524:           caching over a limited time. To use it, install sudo
                   5525:           (either as binary package or from <a xmlns=
                   5526:           "http://www.w3.org/TR/xhtml1/transitional" href=
1.1       grant    5527:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/sudo/README.html"
1.45      wiz      5528:           target="_top"><code xmlns="" class=
                   5529:           "filename">security/sudo</code></a>) and then put the
                   5530:           following into your <code xmlns=
                   5531:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.20      ben      5532:           "filename">/etc/mk.conf</code>:</p>
1.1       grant    5533:           <pre class="programlisting">
1.51      rillig   5534:     .if exists(${LOCALBASE}/bin/sudo)
                   5535:     SU_CMD=        ${LOCALBASE}/bin/sudo /bin/sh -c
                   5536:     .endif
1.1       grant    5537: </pre>
                   5538:         </div>
                   5539: 
1.52      tv       5540:         <div class="sect1" lang="en">
1.1       grant    5541:           <div class="titlepage">
                   5542:             <div>
                   5543:               <div>
                   5544:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       5545:                 "faq.conf"></a>7.14.&nbsp;How do I change the
                   5546:                 location of configuration files?</h2>
1.1       grant    5547:               </div>
                   5548:             </div>
                   5549:           </div>
                   5550: 
1.35      jmmv     5551:           <p>As the system administrator, you can choose where
                   5552:           configuration files are installed. The default settings
1.45      wiz      5553:           make all these files go into <code xmlns=
                   5554:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     5555:           "filename">${PREFIX}/etc</code> or some of its
                   5556:           subdirectories; this may be suboptimal depending on your
                   5557:           expectations (e.g., a read-only, NFS-exported
                   5558:           <code class="varname">PREFIX</code> with a need of
                   5559:           per-machine configuration of the provided packages).</p>
                   5560: 
                   5561:           <p>In order to change the defaults, you can modify the
                   5562:           <code class="varname">PKG_SYSCONFBASE</code> variable (in
1.45      wiz      5563:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   5564:           class="filename">/etc/mk.conf</code>) to point to your
                   5565:           preferred configuration directory; some common examples
                   5566:           include <code xmlns=
                   5567:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   5568:           "filename">/etc</code> or <code xmlns=
                   5569:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   5570:           "filename">/etc/pkg</code>.</p>
1.35      jmmv     5571: 
                   5572:           <p>Furthermore, you can change this value on a
                   5573:           per-package basis by setting the <code class=
                   5574:           "varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code>
                   5575:           variable. <code class="varname">PKG_SYSCONFVAR</code>'s
                   5576:           value usually matches the name of the package you would
                   5577:           like to modify, that is, the contents of <code class=
                   5578:           "varname">PKGBASE</code>.</p>
1.1       grant    5579: 
1.47      reed     5580:           <p>Note that after changing these settings, you must
1.35      jmmv     5581:           rebuild and reinstall any affected packages.</p>
1.1       grant    5582:         </div>
                   5583: 
1.52      tv       5584:         <div class="sect1" lang="en">
1.1       grant    5585:           <div class="titlepage">
                   5586:             <div>
                   5587:               <div>
                   5588:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    5589:                 "audit-packages"></a>7.15.&nbsp;Automated security
1.1       grant    5590:                 checks</h2>
                   5591:               </div>
                   5592:             </div>
                   5593:           </div>
                   5594: 
                   5595:           <p>Please be aware that there can often be bugs in
                   5596:           third-party software, and some of these bugs can leave a
                   5597:           machine vulnerable to exploitation by attackers. In an
                   5598:           effort to lessen the exposure, the NetBSD packages team
                   5599:           maintains a database of known-exploits to packages which
                   5600:           have at one time been included in pkgsrc. The database
                   5601:           can be downloaded automatically, and a security audit of
                   5602:           all packages installed on a system can take place. To do
                   5603:           this, install the <a xmlns=
                   5604:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   5605:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/audit-packages/README.html"
1.45      wiz      5606:           target="_top"><code xmlns="" class=
                   5607:           "filename">security/audit-packages</code></a> package. It
1.20      ben      5608:           has two components:</p>
1.1       grant    5609: 
                   5610:           <div class="orderedlist">
                   5611:             <ol type="1">
                   5612:               <li>
1.34      wiz      5613:                 <p><span><strong class=
                   5614:                 "command">download-vulnerability-list</strong></span>,
1.1       grant    5615:                 an easy way to download a list of the security
                   5616:                 vulnerabilities information. This list is kept up
                   5617:                 to date by the NetBSD security officer and the
                   5618:                 NetBSD packages team, and is distributed from the
                   5619:                 NetBSD ftp server:</p>
                   5620: 
                   5621:                 <p><a href=
                   5622:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/pkg-vulnerabilities"
1.20      ben      5623:                 target=
                   5624:                 "_top">ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/pkg-vulnerabilities</a></p>
1.1       grant    5625:               </li>
                   5626: 
                   5627:               <li>
1.34      wiz      5628:                 <p><span><strong class=
                   5629:                 "command">audit-packages</strong></span>, an easy
                   5630:                 way to audit the current machine, checking each
1.1       grant    5631:                 vulnerability which is known. If a vulnerable
                   5632:                 package is installed, it will be shown by output to
                   5633:                 stdout, including a description of the type of
                   5634:                 vulnerability, and a URL containing more
                   5635:                 information.</p>
                   5636:               </li>
                   5637:             </ol>
                   5638:           </div>
                   5639: 
1.23      wiz      5640:           <p>Use of the <a xmlns=
                   5641:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   5642:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/audit-packages/README.html"
1.45      wiz      5643:           target="_top"><code xmlns="" class=
                   5644:           "filename">security/audit-packages</code></a> package is
1.23      wiz      5645:           strongly recommended! After &#8220;<span class=
                   5646:           "quote">audit-packages</span>&#8221; is installed, please
                   5647:           read the package's message, which you can get by running
                   5648:           <strong class="userinput"><code>pkg_info -D
                   5649:           audit-package</code></strong>.</p>
1.1       grant    5650:         </div>
                   5651:       </div>
                   5652:     </div>
                   5653: 
1.52      tv       5654:     <div class="part" lang="en">
1.1       grant    5655:       <div class="titlepage">
                   5656:         <div>
                   5657:           <div>
1.52      tv       5658:             <h1 class="title"><a name=
1.48      dillo    5659:             "developers-guide"></a>Part&nbsp;II.&nbsp;The pkgsrc
                   5660:             developer's guide</h1>
1.1       grant    5661:           </div>
                   5662:         </div>
                   5663:       </div>
                   5664: 
                   5665:       <div class="toc">
                   5666:         <p><b>Table of Contents</b></p>
                   5667: 
                   5668:         <dl>
1.38      dillo    5669:           <dt><span class="chapter"><a href="#components">8.
1.27      rillig   5670:           Package components - files, directories and
                   5671:           contents</a></span></dt>
                   5672: 
                   5673:           <dd>
                   5674:             <dl>
                   5675:               <dt><span class="sect1"><a href=
1.45      wiz      5676:               "#components.Makefile">8.1. <code xmlns=
                   5677:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   5678:               "filename">Makefile</code></a></span></dt>
                   5679: 
                   5680:               <dt><span class="sect1"><a href=
1.45      wiz      5681:               "#components.distinfo">8.2. <code xmlns=
                   5682:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   5683:               "filename">distinfo</code></a></span></dt>
                   5684: 
                   5685:               <dt><span class="sect1"><a href=
1.38      dillo    5686:               "#components.patches">8.3. patches/*</a></span></dt>
1.27      rillig   5687: 
1.30      wiz      5688:               <dt><span class="sect1"><a href=
1.38      dillo    5689:               "#other-mandatory-files">8.4. Other mandatory
1.30      wiz      5690:               files</a></span></dt>
1.27      rillig   5691: 
                   5692:               <dt><span class="sect1"><a href=
1.38      dillo    5693:               "#components.optional">8.5. Optional
1.27      rillig   5694:               files</a></span></dt>
                   5695: 
1.38      dillo    5696:               <dt><span class="sect1"><a href="#work-dir">8.6.
1.45      wiz      5697:               <code xmlns=
                   5698:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   5699:               "filename">work*</code></a></span></dt>
1.27      rillig   5700: 
1.38      dillo    5701:               <dt><span class="sect1"><a href="#files-dir">8.7.
1.45      wiz      5702:               <code xmlns=
                   5703:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   5704:               "filename">files/*</code></a></span></dt>
1.27      rillig   5705:             </dl>
                   5706:           </dd>
                   5707: 
1.38      dillo    5708:           <dt><span class="chapter"><a href="#makefile">9.
1.45      wiz      5709:           Programming in <code xmlns=
                   5710:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.25      rillig   5711:           "filename">Makefile</code>s</a></span></dt>
                   5712: 
                   5713:           <dd>
                   5714:             <dl>
                   5715:               <dt><span class="sect1"><a href=
1.45      wiz      5716:               "#makefile.variables">9.1. <code xmlns=
                   5717:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.25      rillig   5718:               "filename">Makefile</code> variables</a></span></dt>
                   5719: 
1.27      rillig   5720:               <dd>
                   5721:                 <dl>
                   5722:                   <dt><span class="sect2"><a href=
1.38      dillo    5723:                   "#makefile.variables.names">9.1.1. Naming
1.27      rillig   5724:                   conventions</a></span></dt>
                   5725:                 </dl>
                   5726:               </dd>
                   5727: 
1.38      dillo    5728:               <dt><span class="sect1"><a href="#makefile.code">9.2.
1.25      rillig   5729:               Code snippets</a></span></dt>
                   5730: 
                   5731:               <dd>
                   5732:                 <dl>
                   5733:                   <dt><span class="sect2"><a href=
1.38      dillo    5734:                   "#adding-to-list">9.2.1. Adding things to a
1.25      rillig   5735:                   list</a></span></dt>
                   5736: 
                   5737:                   <dt><span class="sect2"><a href=
1.38      dillo    5738:                   "#converting-internal-to-external">9.2.2.
1.30      wiz      5739:                   Converting an internal list into an external
                   5740:                   list</a></span></dt>
1.25      rillig   5741: 
                   5742:                   <dt><span class="sect2"><a href=
1.38      dillo    5743:                   "#passing-variable-to-shell">9.2.3. Passing
1.30      wiz      5744:                   variables to a shell command</a></span></dt>
1.27      rillig   5745: 
                   5746:                   <dt><span class="sect2"><a href=
1.38      dillo    5747:                   "#quoting-guideline">9.2.4. Quoting
1.27      rillig   5748:                   guideline</a></span></dt>
                   5749: 
                   5750:                   <dt><span class="sect2"><a href=
1.38      dillo    5751:                   "#bsd-make-bug-workaround">9.2.5. Workaround for
1.30      wiz      5752:                   a bug in BSD Make</a></span></dt>
1.25      rillig   5753:                 </dl>
                   5754:               </dd>
                   5755:             </dl>
                   5756:           </dd>
                   5757: 
1.38      dillo    5758:           <dt><span class="chapter"><a href="#plist">10. PLIST
1.1       grant    5759:           issues</a></span></dt>
                   5760: 
                   5761:           <dd>
                   5762:             <dl>
1.38      dillo    5763:               <dt><span class="sect1"><a href="#rcs-id">10.1. RCS
1.1       grant    5764:               ID</a></span></dt>
                   5765: 
1.30      wiz      5766:               <dt><span class="sect1"><a href=
1.38      dillo    5767:               "#automatic-plist-generation">10.2. Semi-automatic
1.45      wiz      5768:               <code xmlns=
                   5769:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   5770:               "filename">PLIST</code> generation</a></span></dt>
1.1       grant    5771: 
1.38      dillo    5772:               <dt><span class="sect1"><a href="#print-PLIST">10.3.
1.14      xtraeme  5773:               Tweaking output of <span><strong class="command">make
                   5774:               print-PLIST</strong></span></a></span></dt>
1.1       grant    5775: 
1.38      dillo    5776:               <dt><span class="sect1"><a href="#plist.misc">10.4.
1.1       grant    5777:               Variable substitution in PLIST</a></span></dt>
                   5778: 
1.30      wiz      5779:               <dt><span class="sect1"><a href=
1.48      dillo    5780:               "#manpage-compression">10.5. Man page
                   5781:               compression</a></span></dt>
1.1       grant    5782: 
1.30      wiz      5783:               <dt><span class="sect1"><a href=
1.38      dillo    5784:               "#using-PLIST_SRC">10.6. Changing PLIST source with
1.30      wiz      5785:               <code class=
1.14      xtraeme  5786:               "varname">PLIST_SRC</code></a></span></dt>
1.1       grant    5787: 
1.30      wiz      5788:               <dt><span class="sect1"><a href=
1.47      reed     5789:               "#platform-specific-plist">10.7. Platform-specific
1.38      dillo    5790:               and differing PLISTs</a></span></dt>
1.1       grant    5791: 
                   5792:               <dt><span class="sect1"><a href=
1.38      dillo    5793:               "#faq.common-dirs">10.8. Sharing directories between
1.1       grant    5794:               packages</a></span></dt>
                   5795:             </dl>
                   5796:           </dd>
                   5797: 
1.38      dillo    5798:           <dt><span class="chapter"><a href="#buildlink">11.
1.1       grant    5799:           Buildlink methodology</a></span></dt>
                   5800: 
                   5801:           <dd>
                   5802:             <dl>
1.30      wiz      5803:               <dt><span class="sect1"><a href=
1.38      dillo    5804:               "#converting-to-buildlink3">11.1. Converting packages
1.30      wiz      5805:               to use buildlink3</a></span></dt>
1.1       grant    5806: 
1.30      wiz      5807:               <dt><span class="sect1"><a href=
1.45      wiz      5808:               "#creating-buildlink3.mk">11.2. Writing <code xmlns=
                   5809:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.30      wiz      5810:               "filename">buildlink3.mk</code> files</a></span></dt>
1.1       grant    5811: 
                   5812:               <dd>
                   5813:                 <dl>
                   5814:                   <dt><span class="sect2"><a href=
1.38      dillo    5815:                   "#anatomy-of-bl3">11.2.1. Anatomy of a
1.30      wiz      5816:                   buildlink3.mk file</a></span></dt>
1.1       grant    5817: 
                   5818:                   <dt><span class="sect2"><a href=
1.38      dillo    5819:                   "#updating-buildlink-depends">11.2.2. Updating
1.30      wiz      5820:                   <code class=
1.52      tv       5821:                   "varname">BUILDLINK_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
                   5822:                   in <code xmlns=
1.45      wiz      5823:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.30      wiz      5824:                   "filename">buildlink3.mk</code>
1.1       grant    5825:                   files</a></span></dt>
                   5826:                 </dl>
                   5827:               </dd>
                   5828: 
1.30      wiz      5829:               <dt><span class="sect1"><a href=
1.45      wiz      5830:               "#writing-builtin.mk">11.3. Writing <code xmlns=
                   5831:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.30      wiz      5832:               "filename">builtin.mk</code> files</a></span></dt>
1.1       grant    5833: 
                   5834:               <dd>
                   5835:                 <dl>
                   5836:                   <dt><span class="sect2"><a href=
1.38      dillo    5837:                   "#anatomy-of-builtin.mk">11.3.1. Anatomy of a
1.45      wiz      5838:                   <code xmlns=
                   5839:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   5840:                   "filename">builtin.mk</code> file</a></span></dt>
1.1       grant    5841: 
                   5842:                   <dt><span class="sect2"><a href=
1.38      dillo    5843:                   "#native-or-pkgsrc-preference">11.3.2. Global
1.30      wiz      5844:                   preferences for native or pkgsrc
                   5845:                   software</a></span></dt>
1.1       grant    5846:                 </dl>
                   5847:               </dd>
                   5848:             </dl>
                   5849:           </dd>
                   5850: 
1.38      dillo    5851:           <dt><span class="chapter"><a href="#pkginstall">12. The
1.35      jmmv     5852:           pkginstall framework</a></span></dt>
                   5853: 
                   5854:           <dd>
                   5855:             <dl>
                   5856:               <dt><span class="sect1"><a href=
1.38      dillo    5857:               "#files-and-dirs-outside-prefix">12.1. Files and
1.35      jmmv     5858:               directories outside the installation
                   5859:               prefix</a></span></dt>
                   5860: 
                   5861:               <dd>
                   5862:                 <dl>
                   5863:                   <dt><span class="sect2"><a href=
1.38      dillo    5864:                   "#dirs-outside-prefix">12.1.1. Directory
1.35      jmmv     5865:                   manipulation</a></span></dt>
                   5866: 
                   5867:                   <dt><span class="sect2"><a href=
1.38      dillo    5868:                   "#files-outside-prefix">12.1.2. File
1.35      jmmv     5869:                   manipulation</a></span></dt>
                   5870:                 </dl>
                   5871:               </dd>
                   5872: 
1.38      dillo    5873:               <dt><span class="sect1"><a href="#conf-files">12.2.
1.35      jmmv     5874:               Configuration files</a></span></dt>
                   5875: 
                   5876:               <dd>
                   5877:                 <dl>
                   5878:                   <dt><span class="sect2"><a href=
1.38      dillo    5879:                   "#conf-files-sysconfdir">12.2.1. How <code class=
1.35      jmmv     5880:                   "varname">PKG_SYSCONFDIR</code> is
                   5881:                   set</a></span></dt>
                   5882: 
                   5883:                   <dt><span class="sect2"><a href=
1.38      dillo    5884:                   "#conf-files-configure">12.2.2. Telling the
1.47      reed     5885:                   software where configuration files
1.35      jmmv     5886:                   are</a></span></dt>
                   5887: 
                   5888:                   <dt><span class="sect2"><a href=
1.38      dillo    5889:                   "#conf-files-patching">12.2.3. Patching
1.35      jmmv     5890:                   installations</a></span></dt>
                   5891: 
                   5892:                   <dt><span class="sect2"><a href=
1.38      dillo    5893:                   "#conf-files-disable">12.2.4. Disabling handling
1.35      jmmv     5894:                   of configuration files</a></span></dt>
                   5895:                 </dl>
                   5896:               </dd>
                   5897: 
1.38      dillo    5898:               <dt><span class="sect1"><a href="#rcd-scripts">12.3.
1.35      jmmv     5899:               System startup scripts</a></span></dt>
                   5900: 
                   5901:               <dd>
                   5902:                 <dl>
                   5903:                   <dt><span class="sect2"><a href=
1.38      dillo    5904:                   "#rcd-scripts-disable">12.3.1. Disabling handling
1.35      jmmv     5905:                   of system startup scripts</a></span></dt>
                   5906:                 </dl>
                   5907:               </dd>
                   5908: 
                   5909:               <dt><span class="sect1"><a href=
1.38      dillo    5910:               "#users-and-groups">12.4. System users and
1.35      jmmv     5911:               groups</a></span></dt>
                   5912: 
1.38      dillo    5913:               <dt><span class="sect1"><a href="#shells">12.5.
1.35      jmmv     5914:               System shells</a></span></dt>
                   5915: 
                   5916:               <dd>
                   5917:                 <dl>
                   5918:                   <dt><span class="sect2"><a href=
1.38      dillo    5919:                   "#shells-disable">12.5.1. Disabling handling of
1.35      jmmv     5920:                   configuration files</a></span></dt>
                   5921:                 </dl>
                   5922:               </dd>
                   5923:             </dl>
                   5924:           </dd>
                   5925: 
1.38      dillo    5926:           <dt><span class="chapter"><a href="#options">13. Options
1.1       grant    5927:           handling</a></span></dt>
                   5928: 
                   5929:           <dd>
                   5930:             <dl>
1.30      wiz      5931:               <dt><span class="sect1"><a href=
1.38      dillo    5932:               "#global-default-options">13.1. Global default
1.30      wiz      5933:               options</a></span></dt>
1.1       grant    5934: 
1.30      wiz      5935:               <dt><span class="sect1"><a href=
1.38      dillo    5936:               "#converting-to-options">13.2. Converting packages to
1.45      wiz      5937:               use <code xmlns=
                   5938:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  5939:               "filename">bsd.options.mk</code></a></span></dt>
1.48      dillo    5940: 
                   5941:               <dt><span class="sect1"><a href="#option-names">13.3.
                   5942:               Option Names</a></span></dt>
1.1       grant    5943:             </dl>
                   5944:           </dd>
                   5945: 
1.38      dillo    5946:           <dt><span class="chapter"><a href="#build">14. The build
1.1       grant    5947:           process</a></span></dt>
                   5948: 
                   5949:           <dd>
                   5950:             <dl>
1.38      dillo    5951:               <dt><span class="sect1"><a href="#build.prefix">14.1.
1.1       grant    5952:               Program location</a></span></dt>
                   5953: 
1.38      dillo    5954:               <dt><span class="sect1"><a href="#main-targets">14.2.
1.1       grant    5955:               Main targets</a></span></dt>
                   5956: 
                   5957:               <dt><span class="sect1"><a href=
1.38      dillo    5958:               "#build.helpful-targets">14.3. Other helpful
1.1       grant    5959:               targets</a></span></dt>
                   5960:             </dl>
                   5961:           </dd>
                   5962: 
1.38      dillo    5963:           <dt><span class="chapter"><a href="#fixes">15. Notes on
1.1       grant    5964:           fixes for packages</a></span></dt>
                   5965: 
                   5966:           <dd>
                   5967:             <dl>
1.30      wiz      5968:               <dt><span class="sect1"><a href=
1.38      dillo    5969:               "#general-operation">15.1. General
1.30      wiz      5970:               operation</a></span></dt>
1.1       grant    5971: 
                   5972:               <dd>
                   5973:                 <dl>
                   5974:                   <dt><span class="sect2"><a href=
1.38      dillo    5975:                   "#pulling-vars-from-etc-mk.conf">15.1.1. How to
1.30      wiz      5976:                   pull in variables from
                   5977:                   /etc/mk.conf</a></span></dt>
1.1       grant    5978: 
                   5979:                   <dt><span class="sect2"><a href=
1.38      dillo    5980:                   "#where-to-install-documentation">15.1.2. Where
1.31      wiz      5981:                   to install documentation</a></span></dt>
                   5982: 
                   5983:                   <dt><span class="sect2"><a href=
1.38      dillo    5984:                   "#restricted-packages">15.1.3. Restricted
1.1       grant    5985:                   packages</a></span></dt>
                   5986: 
                   5987:                   <dt><span class="sect2"><a href=
1.38      dillo    5988:                   "#dependencies">15.1.4. Handling
1.1       grant    5989:                   dependencies</a></span></dt>
                   5990: 
                   5991:                   <dt><span class="sect2"><a href=
1.38      dillo    5992:                   "#conflicts">15.1.5. Handling conflicts with
1.1       grant    5993:                   other packages</a></span></dt>
                   5994: 
                   5995:                   <dt><span class="sect2"><a href=
1.38      dillo    5996:                   "#not-building-packages">15.1.6. Packages that
1.30      wiz      5997:                   cannot or should not be built</a></span></dt>
1.1       grant    5998: 
                   5999:                   <dt><span class="sect2"><a href=
1.38      dillo    6000:                   "#undeletable-packages">15.1.7. Packages which
1.30      wiz      6001:                   should not be deleted, once
                   6002:                   installed</a></span></dt>
1.1       grant    6003: 
                   6004:                   <dt><span class="sect2"><a href=
1.38      dillo    6005:                   "#security-handling">15.1.8. Handling packages
1.1       grant    6006:                   with security problems</a></span></dt>
                   6007: 
                   6008:                   <dt><span class="sect2"><a href=
1.38      dillo    6009:                   "#compiler-bugs">15.1.9. How to handle compiler
1.1       grant    6010:                   bugs</a></span></dt>
                   6011: 
                   6012:                   <dt><span class="sect2"><a href=
1.38      dillo    6013:                   "#bumping-pkgrevision">15.1.10. How to handle
1.30      wiz      6014:                   incrementing versions when fixing an existing
1.1       grant    6015:                   package</a></span></dt>
                   6016: 
                   6017:                   <dt><span class="sect2"><a href=
1.38      dillo    6018:                   "#portability-of-packages">15.1.11. Portability
1.30      wiz      6019:                   of packages</a></span></dt>
1.1       grant    6020:                 </dl>
                   6021:               </dd>
                   6022: 
1.30      wiz      6023:               <dt><span class="sect1"><a href=
1.38      dillo    6024:               "#downloading-issues">15.2. Possible downloading
1.30      wiz      6025:               issues</a></span></dt>
1.1       grant    6026: 
                   6027:               <dd>
                   6028:                 <dl>
                   6029:                   <dt><span class="sect2"><a href=
1.38      dillo    6030:                   "#no-plain-download">15.2.1. Packages whose
1.30      wiz      6031:                   distfiles aren't available for plain
1.1       grant    6032:                   downloading</a></span></dt>
                   6033: 
                   6034:                   <dt><span class="sect2"><a href=
1.38      dillo    6035:                   "#modified-distfiles-same-name">15.2.2. How to
1.30      wiz      6036:                   handle modified distfiles with the 'old'
                   6037:                   name</a></span></dt>
1.1       grant    6038:                 </dl>
                   6039:               </dd>
                   6040: 
1.30      wiz      6041:               <dt><span class="sect1"><a href=
1.38      dillo    6042:               "#configuration-gotchas">15.3. Configuration
1.30      wiz      6043:               gotchas</a></span></dt>
1.1       grant    6044: 
                   6045:               <dd>
                   6046:                 <dl>
                   6047:                   <dt><span class="sect2"><a href=
1.38      dillo    6048:                   "#fixes.libtool">15.3.1. Shared libraries -
1.1       grant    6049:                   libtool</a></span></dt>
                   6050: 
                   6051:                   <dt><span class="sect2"><a href=
1.38      dillo    6052:                   "#using-libtool">15.3.2. Using libtool on GNU
1.1       grant    6053:                   packages that already support
                   6054:                   libtool</a></span></dt>
                   6055: 
                   6056:                   <dt><span class="sect2"><a href=
1.38      dillo    6057:                   "#autoconf-automake">15.3.3. GNU
1.1       grant    6058:                   Autoconf/Automake</a></span></dt>
                   6059:                 </dl>
                   6060:               </dd>
                   6061: 
1.30      wiz      6062:               <dt><span class="sect1"><a href=
1.38      dillo    6063:               "#building-considerations">15.4. Building
1.30      wiz      6064:               considerations</a></span></dt>
1.1       grant    6065: 
                   6066:               <dd>
                   6067:                 <dl>
                   6068:                   <dt><span class="sect2"><a href=
1.38      dillo    6069:                   "#cpp-defines">15.4.1. CPP
1.30      wiz      6070:                   defines</a></span></dt>
1.51      rillig   6071: 
                   6072:                   <dt><span class="sect2"><a href=
                   6073:                   "#cpp-list">15.4.2. Getting a list of CPP
                   6074:                   defines</a></span></dt>
1.1       grant    6075:                 </dl>
                   6076:               </dd>
                   6077: 
1.30      wiz      6078:               <dt><span class="sect1"><a href=
1.38      dillo    6079:               "#package-specific-actions">15.5. Package specific
1.30      wiz      6080:               actions</a></span></dt>
1.1       grant    6081: 
                   6082:               <dd>
                   6083:                 <dl>
                   6084:                   <dt><span class="sect2"><a href=
1.38      dillo    6085:                   "#user-interaction">15.5.1. User
1.2       hubertf  6086:                   interaction</a></span></dt>
1.1       grant    6087: 
                   6088:                   <dt><span class="sect2"><a href=
1.38      dillo    6089:                   "#handling-licenses">15.5.2. Handling
1.1       grant    6090:                   licenses</a></span></dt>
                   6091: 
                   6092:                   <dt><span class="sect2"><a href=
1.38      dillo    6093:                   "#installing-score-files">15.5.3. Installing
1.30      wiz      6094:                   score files</a></span></dt>
1.1       grant    6095: 
                   6096:                   <dt><span class="sect2"><a href=
1.38      dillo    6097:                   "#perl-scripts">15.5.4. Packages containing perl
1.1       grant    6098:                   scripts</a></span></dt>
                   6099: 
                   6100:                   <dt><span class="sect2"><a href=
1.38      dillo    6101:                   "#hardcoded-paths">15.5.5. Packages with
1.30      wiz      6102:                   hardcoded paths to other
                   6103:                   interpreters</a></span></dt>
1.1       grant    6104: 
                   6105:                   <dt><span class="sect2"><a href=
1.38      dillo    6106:                   "#perl-modules">15.5.6. Packages installing perl
1.1       grant    6107:                   modules</a></span></dt>
                   6108: 
                   6109:                   <dt><span class="sect2"><a href=
1.38      dillo    6110:                   "#faq.info-files">15.5.7. Packages installing
1.1       grant    6111:                   info files</a></span></dt>
                   6112: 
                   6113:                   <dt><span class="sect2"><a href=
1.38      dillo    6114:                   "#gconf2-data-files">15.5.8. Packages installing
1.30      wiz      6115:                   GConf2 data files</a></span></dt>
1.1       grant    6116: 
                   6117:                   <dt><span class="sect2"><a href=
1.38      dillo    6118:                   "#scrollkeeper-data-files">15.5.9. Packages
1.30      wiz      6119:                   installing scrollkeeper data
                   6120:                   files</a></span></dt>
1.1       grant    6121: 
                   6122:                   <dt><span class="sect2"><a href=
1.38      dillo    6123:                   "#x11-fonts">15.5.10. Packages installing X11
1.1       grant    6124:                   fonts</a></span></dt>
                   6125: 
                   6126:                   <dt><span class="sect2"><a href=
1.38      dillo    6127:                   "#gtk2-modules">15.5.11. Packages installing GTK2
1.1       grant    6128:                   modules</a></span></dt>
                   6129: 
                   6130:                   <dt><span class="sect2"><a href=
1.38      dillo    6131:                   "#sgml-xml-data">15.5.12. Packages installing
1.30      wiz      6132:                   SGML or XML data</a></span></dt>
1.1       grant    6133: 
                   6134:                   <dt><span class="sect2"><a href=
1.38      dillo    6135:                   "#mime-database">15.5.13. Packages installing
1.1       grant    6136:                   extensions to the MIME database</a></span></dt>
                   6137: 
                   6138:                   <dt><span class="sect2"><a href=
1.38      dillo    6139:                   "#intltool">15.5.14. Packages using
1.1       grant    6140:                   intltool</a></span></dt>
1.18      xtraeme  6141: 
                   6142:                   <dt><span class="sect2"><a href=
1.38      dillo    6143:                   "#startup-scripts">15.5.15. Packages installing
1.30      wiz      6144:                   startup scripts</a></span></dt>
1.1       grant    6145:                 </dl>
                   6146:               </dd>
                   6147: 
1.30      wiz      6148:               <dt><span class="sect1"><a href=
1.38      dillo    6149:               "#feedback-to-author">15.6. Feedback to the
1.30      wiz      6150:               author</a></span></dt>
1.1       grant    6151:             </dl>
                   6152:           </dd>
                   6153: 
1.38      dillo    6154:           <dt><span class="chapter"><a href="#debug">16.
1.1       grant    6155:           Debugging</a></span></dt>
                   6156: 
1.38      dillo    6157:           <dt><span class="chapter"><a href="#submit">17.
1.1       grant    6158:           Submitting and Committing</a></span></dt>
                   6159: 
                   6160:           <dd>
                   6161:             <dl>
1.30      wiz      6162:               <dt><span class="sect1"><a href=
1.38      dillo    6163:               "#submitting-your-package">17.1. Submitting your
1.30      wiz      6164:               packages</a></span></dt>
1.1       grant    6165: 
1.30      wiz      6166:               <dt><span class="sect1"><a href=
1.41      wiz      6167:               "#general-notes-for-changes">17.2. General notes when
                   6168:               adding, updating, or removing
                   6169:               packages</a></span></dt>
                   6170: 
                   6171:               <dt><span class="sect1"><a href=
                   6172:               "#committing-importing">17.3. Committing: Importing a
1.30      wiz      6173:               package into CVS</a></span></dt>
1.1       grant    6174: 
1.30      wiz      6175:               <dt><span class="sect1"><a href=
1.41      wiz      6176:               "#updating-package">17.4. Updating a package to a
1.30      wiz      6177:               newer version</a></span></dt>
1.1       grant    6178: 
1.30      wiz      6179:               <dt><span class="sect1"><a href=
1.41      wiz      6180:               "#moving-package">17.5. Moving a package in
1.30      wiz      6181:               pkgsrc</a></span></dt>
1.1       grant    6182:             </dl>
                   6183:           </dd>
                   6184:         </dl>
                   6185:       </div>
                   6186: 
1.52      tv       6187:       <div class="chapter" lang="en">
1.1       grant    6188:         <div class="titlepage">
                   6189:           <div>
                   6190:             <div>
1.52      tv       6191:               <h2 class="title"><a name=
1.38      dillo    6192:               "components"></a>Chapter&nbsp;8.&nbsp;Package
1.27      rillig   6193:               components - files, directories and contents</h2>
1.25      rillig   6194:             </div>
                   6195:           </div>
                   6196:         </div>
                   6197: 
                   6198:         <div class="toc">
                   6199:           <p><b>Table of Contents</b></p>
                   6200: 
                   6201:           <dl>
                   6202:             <dt><span class="sect1"><a href=
1.45      wiz      6203:             "#components.Makefile">8.1. <code xmlns=
                   6204:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6205:             "filename">Makefile</code></a></span></dt>
                   6206: 
                   6207:             <dt><span class="sect1"><a href=
1.45      wiz      6208:             "#components.distinfo">8.2. <code xmlns=
                   6209:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6210:             "filename">distinfo</code></a></span></dt>
                   6211: 
                   6212:             <dt><span class="sect1"><a href=
1.38      dillo    6213:             "#components.patches">8.3. patches/*</a></span></dt>
1.25      rillig   6214: 
1.30      wiz      6215:             <dt><span class="sect1"><a href=
1.38      dillo    6216:             "#other-mandatory-files">8.4. Other mandatory
1.30      wiz      6217:             files</a></span></dt>
1.25      rillig   6218: 
1.27      rillig   6219:             <dt><span class="sect1"><a href=
1.38      dillo    6220:             "#components.optional">8.5. Optional
1.27      rillig   6221:             files</a></span></dt>
1.25      rillig   6222: 
1.38      dillo    6223:             <dt><span class="sect1"><a href="#work-dir">8.6.
1.45      wiz      6224:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   6225:             class="filename">work*</code></a></span></dt>
1.25      rillig   6226: 
1.38      dillo    6227:             <dt><span class="sect1"><a href="#files-dir">8.7.
1.45      wiz      6228:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   6229:             class="filename">files/*</code></a></span></dt>
1.25      rillig   6230:           </dl>
                   6231:         </div>
                   6232: 
1.27      rillig   6233:         <p>Whenever you're preparing a package, there are a number
                   6234:         of files involved which are described in the following
                   6235:         sections.</p>
1.25      rillig   6236: 
1.52      tv       6237:         <div class="sect1" lang="en">
1.25      rillig   6238:           <div class="titlepage">
                   6239:             <div>
                   6240:               <div>
                   6241:                 <h2 class="title" style="clear: both"><a name=
1.45      wiz      6242:                 "components.Makefile"></a>8.1.&nbsp;<code xmlns=
                   6243:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6244:                 "filename">Makefile</code></h2>
1.25      rillig   6245:               </div>
                   6246:             </div>
                   6247:           </div>
                   6248: 
1.27      rillig   6249:           <p>Building, installation and creation of a binary
1.45      wiz      6250:           package are all controlled by the package's <code xmlns=
                   6251:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   6252:           "filename">Makefile</code>. The <code xmlns=
                   6253:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6254:           "filename">Makefile</code> describes various things about
                   6255:           a package, for example from where to get it, how to
                   6256:           configure, build, and install it.</p>
                   6257: 
1.45      wiz      6258:           <p>A package <code xmlns=
                   6259:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   6260:           "filename">Makefile</code> contains several sections that
                   6261:           describe the package.</p>
1.25      rillig   6262: 
1.27      rillig   6263:           <p>In the first section there are the following
                   6264:           variables, which should appear exactly in the order given
                   6265:           here.</p>
1.25      rillig   6266: 
                   6267:           <div class="itemizedlist">
                   6268:             <ul type="disc">
                   6269:               <li>
1.27      rillig   6270:                 <p><code class="varname">DISTNAME</code> is the
                   6271:                 basename of the distribution file to be downloaded
                   6272:                 from the package's website.</p>
                   6273:               </li>
                   6274: 
                   6275:               <li>
                   6276:                 <p><code class="varname">PKGNAME</code> is the name
                   6277:                 of the package, as used by pkgsrc. You only need to
1.50      rillig   6278:                 provide it if it differs from <code class=
                   6279:                 "varname">DISTNAME</code>. Usually it is the
                   6280:                 directory name together with the version number. It
                   6281:                 must match the regular expression <code class=
1.27      rillig   6282:                 "varname">^[A-Za-z0-9][A-Za-z0-9-_.+]*$</code>,
                   6283:                 that is, it starts with a letter or digit, and
                   6284:                 contains only letters, digits, dashes, underscores,
                   6285:                 dots and plus signs.</p>
1.25      rillig   6286:               </li>
                   6287: 
                   6288:               <li>
1.27      rillig   6289:                 <p><code class="varname">CATEGORIES</code> is a
                   6290:                 list of categories which the package fits in. You
                   6291:                 can choose any of the top-level directories of
                   6292:                 pkgsrc for it.</p>
1.45      wiz      6293: 
                   6294:                 <p>Currently the following values are available for
                   6295:                 <code class="varname">CATEGORIES</code>. If more
                   6296:                 than one is used, they need to be separated by
                   6297:                 spaces:</p>
                   6298:                 <pre class="programlisting">
1.51      rillig   6299:     archivers     cross         geography     meta-pkgs     security
                   6300:     audio         databases     graphics      misc          shells
                   6301:     benchmarks    devel         ham           multimedia    sysutils
                   6302:     biology       editors       inputmethod   net           textproc
                   6303:     cad           emulators     lang          news          time
                   6304:     chat          finance       mail          parallel      wm
                   6305:     comms         fonts         math          pkgtools      www
                   6306:     converters    games         mbone         print         x11
1.45      wiz      6307: </pre>
1.25      rillig   6308:               </li>
                   6309: 
                   6310:               <li>
1.27      rillig   6311:                 <p><code class="varname">MASTER_SITES</code> is a
                   6312:                 list of URLs where the distribution files can be
                   6313:                 downloaded. Each URL must end with a slash.</p>
1.45      wiz      6314: 
                   6315:                 <p>The <code class="varname">MASTER_SITES</code>
                   6316:                 may make use of the following predefined sites:</p>
                   6317:                 <pre class="programlisting">
1.51      rillig   6318:     ${MASTER_SITE_APACHE}
                   6319:     ${MASTER_SITE_BACKUP}
                   6320:     ${MASTER_SITE_CYGWIN}
                   6321:     ${MASTER_SITE_DEBIAN}
                   6322:     ${MASTER_SITE_FREEBSD}
                   6323:     ${MASTER_SITE_FREEBSD_LOCAL}
                   6324:     ${MASTER_SITE_GNOME}
                   6325:     ${MASTER_SITE_GNU}
                   6326:     ${MASTER_SITE_GNUSTEP}
                   6327:     ${MASTER_SITE_IFARCHIVE}
                   6328:     ${MASTER_SITE_MOZILLA}
                   6329:     ${MASTER_SITE_OPENOFFICE}
                   6330:     ${MASTER_SITE_PERL_CPAN}
                   6331:     ${MASTER_SITE_R_CRAN}
                   6332:     ${MASTER_SITE_SOURCEFORGE}
                   6333:     ${MASTER_SITE_SUNSITE}
                   6334:     ${MASTER_SITE_SUSE}
                   6335:     ${MASTER_SITE_TEX_CTAN}
                   6336:     ${MASTER_SITE_XCONTRIB}
                   6337:     ${MASTER_SITE_XEMACS}
1.45      wiz      6338: </pre>
                   6339: 
                   6340:                 <p>If one of these predefined sites is chosen, you
                   6341:                 may want to specify a subdirectory of that site.
                   6342:                 Since these macros may expand to more than one
                   6343:                 actual site, you <span class=
                   6344:                 "emphasis"><em>must</em></span> use the following
                   6345:                 construct to specify a subdirectory:</p>
                   6346:                 <pre class="programlisting">
1.51      rillig   6347:     ${MASTER_SITE_GNU:=subdirectory/name/}
                   6348:     ${MASTER_SITE_SOURCEFORGE:=project_name/}
1.45      wiz      6349: </pre>
                   6350: 
                   6351:                 <p>Note the trailing slash after the subdirectory
                   6352:                 name.</p>
                   6353: 
                   6354:                 <p>If the package has multiple <code class=
                   6355:                 "varname">DISTFILES</code> or multiple <code class=
                   6356:                 "varname">PATCHFILES</code> from different sites,
                   6357:                 set <code class="varname">SITES_foo</code> to a
1.47      reed     6358:                 list of URIs where file &#8220;<span class=
1.45      wiz      6359:                 "quote">foo</span>&#8221; may be found.
                   6360:                 &#8220;<span class="quote">foo</span>&#8221;
1.47      reed     6361:                 includes the suffix, e.g.:</p>
1.45      wiz      6362:                 <pre class="programlisting">
1.51      rillig   6363:     DISTFILES=      ${DISTNAME}${EXTRACT_SUFX}
                   6364:     DISTFILES+=     foo-file.tar.gz
                   6365:     SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \
                   6366:             http://www.somewhereelse.com/mirror/somehow/
1.45      wiz      6367: </pre>
                   6368:               </li>
                   6369: 
                   6370:               <li>
                   6371:                 <p><code class="varname">DISTFILES</code>: Name(s)
                   6372:                 of archive file(s) containing distribution. The
                   6373:                 default is <code xmlns=
                   6374:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6375:                 "filename">${DISTNAME}${EXTRACT_SUFX}</code>.
                   6376:                 Should only be set if you have more than one
                   6377:                 distfile.</p>
                   6378: 
                   6379:                 <p>Note that the normal default setting of
                   6380:                 <code class="varname">DISTFILES</code> must be made
                   6381:                 explicit if you want to add to it (rather than
                   6382:                 replace it), as you usually would.</p>
                   6383:               </li>
                   6384: 
                   6385:               <li>
                   6386:                 <p><code class="varname">EXTRACT_SUFX</code>:
                   6387:                 Suffix of the distribution file, will be appended
                   6388:                 to <code class="varname">DISTNAME</code>. Defaults
                   6389:                 to <code xmlns=
                   6390:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6391:                 "filename">.tar.gz</code>.</p>
                   6392:               </li>
                   6393:             </ul>
                   6394:           </div>
                   6395: 
                   6396:           <p>The second section contains information about
                   6397:           separately downloaded patches, if any.</p>
                   6398: 
                   6399:           <div class="itemizedlist">
                   6400:             <ul type="disc">
                   6401:               <li>
1.47      reed     6402:                 <p><code class="varname">PATCHFILES:</code> Name(s)
1.45      wiz      6403:                 of additional files that contain distribution
                   6404:                 patches. There is no default. pkgsrc will look for
                   6405:                 them at <code class="varname">PATCH_SITES</code>.
                   6406:                 They will automatically be uncompressed before
                   6407:                 patching if the names end with <code xmlns=
                   6408:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6409:                 "filename">.gz</code> or <code xmlns=
                   6410:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6411:                 "filename">.Z</code>.</p>
                   6412:               </li>
                   6413: 
                   6414:               <li>
                   6415:                 <p><code class="varname">PATCH_SITES</code>:
                   6416:                 Primary location(s) for distribution patch files
                   6417:                 (see <code class="varname">PATCHFILES</code> below)
                   6418:                 if not found locally.</p>
1.25      rillig   6419:               </li>
                   6420:             </ul>
                   6421:           </div>
                   6422: 
1.45      wiz      6423:           <p>The third section contains the following
1.27      rillig   6424:           variables.</p>
1.25      rillig   6425: 
1.27      rillig   6426:           <div class="itemizedlist">
                   6427:             <ul type="disc">
                   6428:               <li>
                   6429:                 <p><code class="varname">MAINTAINER</code> is the
1.50      rillig   6430:                 email address of the person who feels responsible
                   6431:                 for this package, and who is most likely to look at
                   6432:                 problems or questions regarding this package which
                   6433:                 have been reported with <a href=
1.45      wiz      6434:                 "http://netbsd.gw.com/cgi-bin/man-cgi?send-pr+1+NetBSD-current">
                   6435:                 <span class="citerefentry"><span class=
1.50      rillig   6436:                 "refentrytitle">send-pr</span>(1)</span></a>. Other
                   6437:                 developers should contact the <code class=
                   6438:                 "varname">MAINTAINER</code> before making major
                   6439:                 changes to the package. When packaging a new
                   6440:                 program, set <code class=
                   6441:                 "varname">MAINTAINER</code> to yourself. If you
                   6442:                 really can't maintain the package for future
                   6443:                 updates, set it to <code class="email">&lt;<a href=
1.45      wiz      6444:                 "mailto:tech-pkg@NetBSD.org">tech-pkg@NetBSD.org</a>&gt;</code>.</p>
1.27      rillig   6445:               </li>
1.25      rillig   6446: 
1.27      rillig   6447:               <li>
                   6448:                 <p><code class="varname">HOMEPAGE</code> is a URL
                   6449:                 where users can find more information about the
1.23      wiz      6450:                 package.</p>
                   6451:               </li>
1.1       grant    6452: 
1.23      wiz      6453:               <li>
                   6454:                 <p><code class="varname">COMMENT</code> is a
1.45      wiz      6455:                 one-line description of the package (should not
                   6456:                 include the package name).</p>
1.23      wiz      6457:               </li>
                   6458:             </ul>
                   6459:           </div>
1.1       grant    6460: 
1.45      wiz      6461:           <p>Other variables that affect the build:</p>
1.1       grant    6462: 
1.45      wiz      6463:           <div class="itemizedlist">
                   6464:             <ul type="disc">
                   6465:               <li>
                   6466:                 <p><code class="varname">WRKSRC</code>: The
1.50      rillig   6467:                 directory where the interesting distribution files
                   6468:                 of the package are found. The default is
                   6469:                 <code xmlns=
                   6470:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6471:                 "filename">${WRKDIR}/${DISTNAME}</code>, which
                   6472:                 works for most packages.</p>
                   6473: 
                   6474:                 <p>If a package doesn't create a subdirectory for
                   6475:                 itself (most GNU software does, for instance), but
                   6476:                 extracts itself in the current directory, you
                   6477:                 should set <code class="varname">WRKSRC=
                   6478:                 ${WRKDIR}</code>.</p>
                   6479: 
                   6480:                 <p>If a package doesn't create a subdirectory with
                   6481:                 the name of <code class="varname">DISTNAME</code>
                   6482:                 but some different name, set <code class=
                   6483:                 "varname">WRKSRC</code> to point to the proper name
                   6484:                 in <code xmlns=
                   6485:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6486:                 "filename">${WRKDIR}</code>, for example
                   6487:                 <code class="varname">WRKSRC=
                   6488:                 ${WRKDIR}/${DISTNAME}/unix</code>. See <a xmlns=
                   6489:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   6490:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/lang/tcl/README.html"
                   6491:                 target="_top"><code xmlns="" class=
                   6492:                 "filename">lang/tcl</code></a> and <a xmlns=
                   6493:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   6494:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/tk/README.html"
                   6495:                 target="_top"><code xmlns="" class=
                   6496:                 "filename">x11/tk</code></a> for other
                   6497:                 examples.</p>
                   6498: 
                   6499:                 <p>The name of the working directory created by
                   6500:                 pkgsrc is taken from the <code class=
                   6501:                 "varname">WRKDIR_BASENAME</code> variable. By
                   6502:                 default, its value is <code xmlns=
                   6503:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6504:                 "filename">work</code>. If you want to use the same
                   6505:                 pkgsrc tree for building different kinds of binary
                   6506:                 packages, you can change the variable according to
                   6507:                 your needs. Two other variables handle common cases
                   6508:                 of setting <code class=
                   6509:                 "varname">WRKDIR_BASENAME</code> individually. If
                   6510:                 <code class="varname">OBJHOSTNAME</code> is defined
                   6511:                 in <code xmlns=
1.45      wiz      6512:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.50      rillig   6513:                 "filename">/etc/mk.conf</code>, the first component
                   6514:                 of the host's name is attached to the directory
                   6515:                 name. If <code class="varname">OBJMACHINE</code> is
                   6516:                 defined, the platform name is attached, which might
                   6517:                 look like <code xmlns=
                   6518:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6519:                 "filename">work.i386</code> or <code xmlns=
1.45      wiz      6520:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.50      rillig   6521:                 "filename">work.sparc</code>.</p>
1.45      wiz      6522:               </li>
                   6523:             </ul>
1.1       grant    6524:           </div>
                   6525: 
                   6526:           <p>Please pay attention to the following gotchas:</p>
                   6527: 
                   6528:           <div class="itemizedlist">
                   6529:             <ul type="disc">
                   6530:               <li>
1.14      xtraeme  6531:                 <p>Add <code class="varname">MANCOMPRESSED</code>
1.47      reed     6532:                 if man pages are installed in compressed form by
                   6533:                 the package; see comment in <code xmlns=
1.45      wiz      6534:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  6535:                 "filename">bsd.pkg.mk</code>.</p>
1.1       grant    6536:               </li>
                   6537: 
                   6538:               <li>
1.45      wiz      6539:                 <p>Replace <code xmlns=
                   6540:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6541:                 "filename">/usr/local</code> with
                   6542:                 &#8220;<span class="quote">${PREFIX}</span>&#8221;
                   6543:                 in all files (see patches, below).</p>
1.1       grant    6544:               </li>
                   6545: 
                   6546:               <li>
                   6547:                 <p>If the package installs any info files, see
                   6548:                 <a href="#faq.info-files" title=
1.45      wiz      6549:                 "15.5.7.&nbsp;Packages installing info files">Section&nbsp;15.5.7,
                   6550:                 &#8220;Packages installing info
1.1       grant    6551:                 files&#8221;</a>.</p>
                   6552:               </li>
                   6553:             </ul>
                   6554:           </div>
                   6555:         </div>
                   6556: 
1.52      tv       6557:         <div class="sect1" lang="en">
1.1       grant    6558:           <div class="titlepage">
                   6559:             <div>
                   6560:               <div>
                   6561:                 <h2 class="title" style="clear: both"><a name=
1.45      wiz      6562:                 "components.distinfo"></a>8.2.&nbsp;<code xmlns=
                   6563:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  6564:                 "filename">distinfo</code></h2>
1.1       grant    6565:               </div>
                   6566:             </div>
                   6567:           </div>
                   6568: 
1.50      rillig   6569:           <p>The <code xmlns=
                   6570:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   6571:           "filename">distinfo</code> file contains the message
                   6572:           digest, or checksum, of each distfile needed for the
                   6573:           package. This ensures that the distfiles retrieved from
                   6574:           the Internet have not been corrupted during transfer or
                   6575:           altered by a malign force to introduce a security hole.
                   6576:           Due to recent rumor about weaknesses of digest
                   6577:           algorithms, all distfiles are protected using both SHA1
                   6578:           and RMD160 message digests, as well as the file size.</p>
                   6579: 
                   6580:           <p>The <code xmlns=
                   6581:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   6582:           "filename">distinfo</code> file also contains the
                   6583:           checksums for all the patches found in the <code xmlns=
                   6584:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   6585:           "filename">patches</code> directory (see <a href=
                   6586:           "#components.patches" title=
                   6587:           "8.3.&nbsp;patches/*">Section&nbsp;8.3,
                   6588:           &#8220;patches/*&#8221;</a>).</p>
                   6589: 
                   6590:           <p>To regenerate the <code xmlns=
                   6591:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   6592:           "filename">distinfo</code> file, use the
1.14      xtraeme  6593:           <span><strong class="command">make
1.50      rillig   6594:           makedistinfo</strong></span> or <span><strong class=
                   6595:           "command">make mdi</strong></span> command.</p>
1.1       grant    6596: 
1.50      rillig   6597:           <p>Some packages have different sets of distfiles
                   6598:           depending on the platform, for example <a xmlns=
1.1       grant    6599:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   6600:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/navigator/README.html"
1.45      wiz      6601:           target="_top"><code xmlns="" class=
                   6602:           "filename">www/navigator</code></a>). These are kept in
1.50      rillig   6603:           the same <code xmlns=
1.45      wiz      6604:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.50      rillig   6605:           "filename">distinfo</code> file and care should be taken
                   6606:           when upgrading such a package to ensure distfile
                   6607:           information is not lost.</p>
1.1       grant    6608:         </div>
                   6609: 
1.52      tv       6610:         <div class="sect1" lang="en">
1.1       grant    6611:           <div class="titlepage">
                   6612:             <div>
                   6613:               <div>
                   6614:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    6615:                 "components.patches"></a>8.3.&nbsp;patches/*</h2>
1.1       grant    6616:               </div>
                   6617:             </div>
                   6618:           </div>
                   6619: 
                   6620:           <p>This directory contains files that are used by the
                   6621:           <a href=
                   6622:           "http://netbsd.gw.com/cgi-bin/man-cgi?patch+1+NetBSD-current">
                   6623:           <span class="citerefentry"><span class=
                   6624:           "refentrytitle">patch</span>(1)</span></a> command to
                   6625:           modify the sources as distributed in the distribution
                   6626:           file into a form that will compile and run perfectly on
                   6627:           NetBSD. The files are applied successively in alphabetic
                   6628:           order (as returned by a shell &#8220;<span class=
                   6629:           "quote">patches/patch-*</span>&#8221; glob expansion), so
1.45      wiz      6630:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   6631:           class="filename">patch-aa</code> is applied before
                   6632:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   6633:           class="filename">patch-ab</code>, etc.</p>
                   6634: 
                   6635:           <p>The <code xmlns=
                   6636:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   6637:           "filename">patch-*</code> files should be in
                   6638:           <span><strong class="command">diff -bu</strong></span>
                   6639:           format, and apply without a fuzz to avoid problems. (To
                   6640:           force patches to apply with fuzz you can set <code class=
1.14      xtraeme  6641:           "varname">PATCH_FUZZ_FACTOR=-F2</code>). Furthermore, do
1.1       grant    6642:           not put changes for more than one file into a single
1.47      reed     6643:           patch file, as this will make future modifications more
1.1       grant    6644:           difficult.</p>
                   6645: 
                   6646:           <p>Similar, a file should be patched at most once, not
                   6647:           several times by several different patches. If a file
                   6648:           needs several patches, they should be combined into one
                   6649:           file.</p>
                   6650: 
                   6651:           <p>One important thing to mention is to pay attention
                   6652:           that no RCS IDs get stored in the patch files, as these
                   6653:           will cause problems when later checked into the NetBSD
1.14      xtraeme  6654:           CVS tree. Use the <span><strong class=
                   6655:           "command">pkgdiff</strong></span> from the <a xmlns=
1.1       grant    6656:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   6657:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdiff/README.html"
1.45      wiz      6658:           target="_top"><code xmlns="" class=
                   6659:           "filename">pkgtools/pkgdiff</code></a> package to avoid
1.20      ben      6660:           these problems.</p>
1.1       grant    6661: 
                   6662:           <p>For even more automation, we recommend using
1.14      xtraeme  6663:           <span><strong class="command">mkpatches</strong></span>
                   6664:           from the same package to make a whole set of patches. You
                   6665:           just have to backup files before you edit them to
1.45      wiz      6666:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   6667:           class="filename">filename.orig</code>, e.g. with
1.14      xtraeme  6668:           <span><strong class="command">cp -p filename
                   6669:           filename.orig</strong></span> or, easier, by using
                   6670:           <span><strong class="command">pkgvi</strong></span> again
                   6671:           from the same package. If you upgrade a package this way,
                   6672:           you can easily compare the new set of patches with the
                   6673:           previously existing one with <span><strong class=
                   6674:           "command">patchdiff</strong></span>.</p>
1.1       grant    6675: 
                   6676:           <p>When you have finished a package, remember to generate
                   6677:           the checksums for the patch files by using the
1.14      xtraeme  6678:           <span><strong class="command">make
                   6679:           makepatchsum</strong></span> command, see <a href=
                   6680:           "#components.distinfo" title=
1.38      dillo    6681:           "8.2.&nbsp;distinfo">Section&nbsp;8.2,
1.45      wiz      6682:           &#8220;<code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   6683:           class="filename">distinfo</code>&#8221;</a>.</p>
1.1       grant    6684: 
1.46      gdt      6685:           <p>When adding a patch that corrects a problem in the
                   6686:           distfile (rather than e.g. enforcing pkgsrc's view of
                   6687:           where man pages should go), send the patch as a bug
                   6688:           report to the maintainer. This benefits non-pkgsrc users
                   6689:           of the package, and usually enables removing the patch in
                   6690:           future version.</p>
                   6691: 
1.1       grant    6692:           <p>Patch files that are distributed by the author or
1.14      xtraeme  6693:           other maintainers can be listed in <code class=
                   6694:           "varname">$PATCHFILES</code>.</p>
1.1       grant    6695: 
                   6696:           <p>If it is desired to store any patches that should not
                   6697:           be committed into pkgsrc, they can be kept outside the
1.45      wiz      6698:           pkgsrc tree in the <code xmlns=
                   6699:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  6700:           "filename">$LOCALPATCHES</code> directory. The directory
1.1       grant    6701:           tree there is expected to have the same
                   6702:           &#8220;<span class="quote">category/package</span>&#8221;
                   6703:           structure as pkgsrc, and patches are expected to be
1.45      wiz      6704:           stored inside these dirs (also known as <code xmlns=
                   6705:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.47      reed     6706:           "filename">$LOCALPATCHES/$PKGPATH</code>). For example,
                   6707:           if you want to keep a private patch for <code xmlns=
1.45      wiz      6708:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  6709:           "filename">pkgsrc/graphics/png</code>, keep it in
1.45      wiz      6710:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   6711:           class=
1.14      xtraeme  6712:           "filename">$LOCALPATCHES/graphics/png/mypatch</code>. All
                   6713:           files in the named directory are expected to be patch
1.1       grant    6714:           files, and <span class="emphasis"><em>they are applied
                   6715:           after pkgsrc patches are applied</em></span>.</p>
1.27      rillig   6716:         </div>
                   6717: 
1.52      tv       6718:         <div class="sect1" lang="en">
1.27      rillig   6719:           <div class="titlepage">
                   6720:             <div>
                   6721:               <div>
                   6722:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    6723:                 "other-mandatory-files"></a>8.4.&nbsp;Other
1.27      rillig   6724:                 mandatory files</h2>
                   6725:               </div>
                   6726:             </div>
                   6727:           </div>
                   6728: 
                   6729:           <div class="variablelist">
                   6730:             <dl>
1.45      wiz      6731:               <dt><span class="term"><code xmlns=
                   6732:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6733:               "filename">DESCR</code></span></dt>
                   6734: 
                   6735:               <dd>
                   6736:                 <p>A multi-line description of the piece of
                   6737:                 software. This should include any credits where
                   6738:                 they are due. Please bear in mind that others do
                   6739:                 not share your sense of humour (or spelling
                   6740:                 idiosyncrasies), and that others will read
                   6741:                 everything that you write here.</p>
                   6742:               </dd>
                   6743: 
1.45      wiz      6744:               <dt><span class="term"><code xmlns=
                   6745:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6746:               "filename">PLIST</code></span></dt>
                   6747: 
                   6748:               <dd>
                   6749:                 <p>This file governs the files that are installed
                   6750:                 on your system: all the binaries, manual pages,
                   6751:                 etc. There are other directives which may be
                   6752:                 entered in this file, to control the creation and
                   6753:                 deletion of directories, and the location of
                   6754:                 inserted files. See <a href="#plist" title=
1.38      dillo    6755:                 "Chapter&nbsp;10.&nbsp;PLIST issues">Chapter&nbsp;10,
1.27      rillig   6756:                 <i>PLIST issues</i></a> for more information.</p>
                   6757:               </dd>
                   6758:             </dl>
                   6759:           </div>
                   6760:         </div>
                   6761: 
1.52      tv       6762:         <div class="sect1" lang="en">
1.27      rillig   6763:           <div class="titlepage">
                   6764:             <div>
                   6765:               <div>
                   6766:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    6767:                 "components.optional"></a>8.5.&nbsp;Optional
1.27      rillig   6768:                 files</h2>
                   6769:               </div>
                   6770:             </div>
                   6771:           </div>
                   6772: 
                   6773:           <div class="variablelist">
                   6774:             <dl>
1.45      wiz      6775:               <dt><span class="term"><code xmlns=
                   6776:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6777:               "filename">INSTALL</code></span></dt>
                   6778: 
                   6779:               <dd>
                   6780:                 <p>This shell script is invoked twice by <a href=
                   6781:                 "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current">
                   6782:                 <span class="citerefentry"><span class=
                   6783:                 "refentrytitle">pkg_add</span>(1)</span></a>. First
                   6784:                 time after package extraction and before files are
                   6785:                 moved in place, the second time after the files to
                   6786:                 install are moved in place. This can be used to do
                   6787:                 any custom procedures not possible with @exec
1.45      wiz      6788:                 commands in <code xmlns=
                   6789:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6790:                 "filename">PLIST</code>. See <a href=
1.27      rillig   6791:                 "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current">
                   6792:                 <span class="citerefentry"><span class=
                   6793:                 "refentrytitle">pkg_add</span>(1)</span></a> and
                   6794:                 <a href=
                   6795:                 "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_create+1+NetBSD-current">
                   6796:                 <span class="citerefentry"><span class=
                   6797:                 "refentrytitle">pkg_create</span>(1)</span></a> for
                   6798:                 more information.</p>
                   6799:               </dd>
                   6800: 
1.45      wiz      6801:               <dt><span class="term"><code xmlns=
                   6802:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6803:               "filename">DEINSTALL</code></span></dt>
                   6804: 
                   6805:               <dd>
                   6806:                 <p>This script is executed before and after any
                   6807:                 files are removed. It is this script's
                   6808:                 responsibility to clean up any additional messy
                   6809:                 details around the package's installation, since
                   6810:                 all pkg_delete knows is how to delete the files
                   6811:                 created in the original distribution. See <a href=
                   6812:                 "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1+NetBSD-current">
                   6813:                 <span class="citerefentry"><span class=
                   6814:                 "refentrytitle">pkg_delete</span>(1)</span></a> and
                   6815:                 <a href=
                   6816:                 "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_create+1+NetBSD-current">
                   6817:                 <span class="citerefentry"><span class=
                   6818:                 "refentrytitle">pkg_create</span>(1)</span></a> for
                   6819:                 more information.</p>
                   6820:               </dd>
                   6821: 
1.45      wiz      6822:               <dt><span class="term"><code xmlns=
                   6823:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6824:               "filename">MESSAGE</code></span></dt>
                   6825: 
                   6826:               <dd>
1.50      rillig   6827:                 <p>This file is displayed after installation of the
1.27      rillig   6828:                 package. Useful for things like legal notices on
                   6829:                 almost-free software and hints for updating config
                   6830:                 files after installing modules for apache, PHP etc.
                   6831:                 Please note that you can modify variables in it
                   6832:                 easily by using <code class=
                   6833:                 "varname">MESSAGE_SUBST</code> in the package's
1.45      wiz      6834:                 <code xmlns=
                   6835:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   6836:                 "filename">Makefile</code>:</p>
1.27      rillig   6837:                 <pre class="programlisting">
1.51      rillig   6838:     MESSAGE_SUBST+=  SOMEVAR="somevalue"
1.27      rillig   6839: </pre>
                   6840: 
                   6841:                 <p>replaces "${SOMEVAR}" with &#8220;<span class=
1.45      wiz      6842:                 "quote">somevalue</span>&#8221; in <code xmlns=
                   6843:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6844:                 "filename">MESSAGE</code>.</p>
                   6845:               </dd>
                   6846:             </dl>
                   6847:           </div>
                   6848:         </div>
                   6849: 
1.52      tv       6850:         <div class="sect1" lang="en">
1.27      rillig   6851:           <div class="titlepage">
                   6852:             <div>
                   6853:               <div>
                   6854:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       6855:                 "work-dir"></a>8.6.&nbsp;<code xmlns=
1.45      wiz      6856:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6857:                 "filename">work*</code></h2>
                   6858:               </div>
                   6859:             </div>
                   6860:           </div>
                   6861: 
                   6862:           <p>When you type <span><strong class=
1.47      reed     6863:           "command">make</strong></span>, the distribution files
                   6864:           are unpacked into the directory denoted by <code class=
1.45      wiz      6865:           "varname">WRKDIR</code>. It can be removed by running
                   6866:           <span><strong class="command">make clean</strong></span>.
                   6867:           Besides the sources, this directory is also used to keep
                   6868:           various timestamp files. The directory gets <span class=
                   6869:           "emphasis"><em>removed completely</em></span> on clean.
                   6870:           The default is <code xmlns=
                   6871:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   6872:           "filename">${.CURDIR}/work</code> or <code xmlns=
                   6873:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   6874:           "filename">${.CURDIR}/work.${MACHINE_ARCH}</code> if
                   6875:           <code class="varname">OBJMACHINE</code> is set.</p>
1.27      rillig   6876:         </div>
                   6877: 
1.52      tv       6878:         <div class="sect1" lang="en">
1.27      rillig   6879:           <div class="titlepage">
                   6880:             <div>
                   6881:               <div>
                   6882:                 <h2 class="title" style="clear: both"><a name=
1.45      wiz      6883:                 "files-dir"></a>8.7.&nbsp;<code xmlns=
                   6884:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6885:                 "filename">files/*</code></h2>
                   6886:               </div>
                   6887:             </div>
                   6888:           </div>
                   6889: 
                   6890:           <p>If you have any files that you wish to be placed in
                   6891:           the package prior to configuration or building, you could
                   6892:           place these files here and use a &#8220;<span class=
                   6893:           "quote">${CP}</span>&#8221; command in the
                   6894:           &#8220;<span class="quote">pre-configure</span>&#8221;
                   6895:           target to achieve this. Alternatively, you could simply
1.45      wiz      6896:           diff the file against <code xmlns=
                   6897:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6898:           "filename">/dev/null</code> and use the patch mechanism
                   6899:           to manage the creation of this file.</p>
                   6900:         </div>
                   6901:       </div>
                   6902: 
1.52      tv       6903:       <div class="chapter" lang="en">
1.27      rillig   6904:         <div class="titlepage">
                   6905:           <div>
                   6906:             <div>
1.52      tv       6907:               <h2 class="title"><a name=
1.38      dillo    6908:               "makefile"></a>Chapter&nbsp;9.&nbsp;Programming in
1.45      wiz      6909:               <code xmlns=
                   6910:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   6911:               "filename">Makefile</code>s</h2>
1.27      rillig   6912:             </div>
                   6913:           </div>
                   6914:         </div>
                   6915: 
                   6916:         <div class="toc">
                   6917:           <p><b>Table of Contents</b></p>
                   6918: 
                   6919:           <dl>
                   6920:             <dt><span class="sect1"><a href=
1.45      wiz      6921:             "#makefile.variables">9.1. <code xmlns=
                   6922:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6923:             "filename">Makefile</code> variables</a></span></dt>
                   6924: 
                   6925:             <dd>
                   6926:               <dl>
                   6927:                 <dt><span class="sect2"><a href=
1.38      dillo    6928:                 "#makefile.variables.names">9.1.1. Naming
1.27      rillig   6929:                 conventions</a></span></dt>
                   6930:               </dl>
                   6931:             </dd>
                   6932: 
1.38      dillo    6933:             <dt><span class="sect1"><a href="#makefile.code">9.2.
1.27      rillig   6934:             Code snippets</a></span></dt>
                   6935: 
                   6936:             <dd>
                   6937:               <dl>
1.30      wiz      6938:                 <dt><span class="sect2"><a href=
1.38      dillo    6939:                 "#adding-to-list">9.2.1. Adding things to a
1.30      wiz      6940:                 list</a></span></dt>
1.27      rillig   6941: 
1.30      wiz      6942:                 <dt><span class="sect2"><a href=
1.38      dillo    6943:                 "#converting-internal-to-external">9.2.2.
1.27      rillig   6944:                 Converting an internal list into an external
                   6945:                 list</a></span></dt>
                   6946: 
1.30      wiz      6947:                 <dt><span class="sect2"><a href=
1.38      dillo    6948:                 "#passing-variable-to-shell">9.2.3. Passing
1.30      wiz      6949:                 variables to a shell command</a></span></dt>
1.27      rillig   6950: 
1.30      wiz      6951:                 <dt><span class="sect2"><a href=
1.38      dillo    6952:                 "#quoting-guideline">9.2.4. Quoting
1.30      wiz      6953:                 guideline</a></span></dt>
1.27      rillig   6954: 
1.30      wiz      6955:                 <dt><span class="sect2"><a href=
1.38      dillo    6956:                 "#bsd-make-bug-workaround">9.2.5. Workaround for a
1.30      wiz      6957:                 bug in BSD Make</a></span></dt>
1.27      rillig   6958:               </dl>
                   6959:             </dd>
                   6960:           </dl>
                   6961:         </div>
                   6962: 
1.45      wiz      6963:         <p>Pkgsrc consists of many <code xmlns=
                   6964:         "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6965:         "filename">Makefile</code> fragments, each of which forms a
                   6966:         well-defined part of the pkgsrc system. Using the <a href=
                   6967:         "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current">
                   6968:         <span class="citerefentry"><span class=
                   6969:         "refentrytitle">make</span>(1)</span></a> system as a
                   6970:         programming language for a big system like pkgsrc requires
                   6971:         some discipline to keep the code correct and
                   6972:         understandable.</p>
                   6973: 
1.45      wiz      6974:         <p>The basic ingredients for <code xmlns=
                   6975:         "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6976:         "filename">Makefile</code> programming are variables (which
                   6977:         are actually macros) and shell commands. Among these shell
                   6978:         commands may even be more complex ones like <a href=
                   6979:         "http://netbsd.gw.com/cgi-bin/man-cgi?awk+1+NetBSD-current">
                   6980:         <span class="citerefentry"><span class=
                   6981:         "refentrytitle">awk</span>(1)</span></a> programs. To make
                   6982:         sure that every shell command runs as intended it is
                   6983:         necessary to quote all variables correctly when they are
                   6984:         used.</p>
                   6985: 
                   6986:         <p>This chapter describes some patterns, that appear quite
1.45      wiz      6987:         often in <code xmlns=
                   6988:         "http://www.w3.org/TR/xhtml1/transitional" class=
                   6989:         "filename">Makefile</code>s, including the pitfalls that
                   6990:         come along with them.</p>
1.27      rillig   6991: 
1.52      tv       6992:         <div class="sect1" lang="en">
1.27      rillig   6993:           <div class="titlepage">
                   6994:             <div>
                   6995:               <div>
                   6996:                 <h2 class="title" style="clear: both"><a name=
1.45      wiz      6997:                 "makefile.variables"></a>9.1.&nbsp;<code xmlns=
                   6998:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   6999:                 "filename">Makefile</code> variables</h2>
                   7000:               </div>
                   7001:             </div>
                   7002:           </div>
                   7003: 
1.45      wiz      7004:           <p><code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   7005:           class="filename">Makefile</code> variables contain
                   7006:           strings that can be processed using the five operators
                   7007:           ``='', ``+='', ``?='', ``:='', and ``!='', which are
                   7008:           described in the <a href=
1.27      rillig   7009:           "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current">
                   7010:           <span class="citerefentry"><span class=
                   7011:           "refentrytitle">make</span>(1)</span></a> man page.</p>
                   7012: 
1.45      wiz      7013:           <p>When a variable's value is parsed from a <code xmlns=
                   7014:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.27      rillig   7015:           "filename">Makefile</code>, the hash character ``#'' and
                   7016:           the backslash character ``\'' are handled specially. If a
                   7017:           backslash is followed by a newline, any whitespace
                   7018:           immediately in front of the backslash, the backslash, the
                   7019:           newline, and any whitespace immediately behind the
                   7020:           newline are replaced with a single space. A backspace
                   7021:           character and an immediately following hash character are
1.47      reed     7022:           replaced with a single hash character. Otherwise, the
1.27      rillig   7023:           backslash is passed as is. In a variable assignment, any
                   7024:           hash character that is not preceded by a backslash starts
                   7025:           a comment that continues upto the end of the logical
                   7026:           line.</p>
                   7027: 
                   7028:           <p><span class="emphasis"><em>Note:</em></span> Because
                   7029:           of this parsing algorithm the only way to create a
                   7030:           variable consisting of a single backslash is using the
                   7031:           ``!='' operator, for example: <code class=
                   7032:           "varname">BACKSLASH!=echo "\\"</code>.</p>
                   7033: 
                   7034:           <p>So far for defining variables. The other thing you can
                   7035:           do with variables is evaluating them. A variable is
                   7036:           evaluated when it is part of the right side of the ``:=''
                   7037:           or the ``!='' operator, or directly before executing a
                   7038:           shell command which the variable is part of. In all other
1.47      reed     7039:           cases, <a href=
1.27      rillig   7040:           "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current">
                   7041:           <span class="citerefentry"><span class=
                   7042:           "refentrytitle">make</span>(1)</span></a> performs lazy
                   7043:           evaluation, that is, variables are not evaluated until
                   7044:           there's no other way. The ``modifiers'' mentioned in the
                   7045:           man page also evaluate the variable.</p>
                   7046: 
                   7047:           <p>Some of the modifiers split the string into words and
                   7048:           then operate on the words, others operate on the string
1.47      reed     7049:           as a whole. When a string is split into words, it is
                   7050:           split as you would expect it from <a href=
1.27      rillig   7051:           "http://netbsd.gw.com/cgi-bin/man-cgi?sh+1+NetBSD-current">
                   7052:           <span class="citerefentry"><span class=
                   7053:           "refentrytitle">sh</span>(1)</span></a>.</p>
                   7054: 
                   7055:           <p>No rule without exception&#8212;the
                   7056:           <span><strong class="command">.for</strong></span> loop
                   7057:           does not follow the shell quoting rules but splits at
                   7058:           sequences of whitespace.</p>
                   7059: 
                   7060:           <p>There are several types of variables that should be
                   7061:           handled differently. Strings and two types of lists.</p>
                   7062: 
                   7063:           <div class="itemizedlist">
                   7064:             <ul type="disc">
                   7065:               <li>
                   7066:                 <p><span class="emphasis"><em>Strings</em></span>
1.47      reed     7067:                 can contain arbitrary characters. Nevertheless, you
1.27      rillig   7068:                 should restrict yourself to only using printable
                   7069:                 characters. Examples are <code class=
                   7070:                 "varname">PREFIX</code> and <code class=
                   7071:                 "varname">COMMENT</code>.</p>
                   7072:               </li>
                   7073: 
                   7074:               <li>
                   7075:                 <p><span class="emphasis"><em>Internal
                   7076:                 lists</em></span> are lists that are never exported
                   7077:                 to any shell command. Their elements are separated
1.47      reed     7078:                 by whitespace. Therefore, the elements themselves
1.27      rillig   7079:                 cannot have embedded whitespace. Any other
                   7080:                 characters are allowed. Internal lists can be used
                   7081:                 in <span><strong class=
                   7082:                 "command">.for</strong></span> loops. Examples are
                   7083:                 <code class="varname">DEPENDS</code> and
                   7084:                 <code class="varname">BUILD_DEPENDS</code>.</p>
                   7085:               </li>
                   7086: 
                   7087:               <li>
                   7088:                 <p><span class="emphasis"><em>External
                   7089:                 lists</em></span> are lists that may be exported to
                   7090:                 a shell command. Their elements can contain any
                   7091:                 characters, including whitespace. That's why they
                   7092:                 cannot be used in <span><strong class=
                   7093:                 "command">.for</strong></span> loops. Examples are
                   7094:                 <code class="varname">DISTFILES</code> and
                   7095:                 <code class="varname">MASTER_SITES</code>.</p>
                   7096:               </li>
                   7097:             </ul>
                   7098:           </div>
                   7099: 
1.52      tv       7100:           <div class="sect2" lang="en">
1.27      rillig   7101:             <div class="titlepage">
                   7102:               <div>
                   7103:                 <div>
                   7104:                   <h3 class="title"><a name=
1.38      dillo    7105:                   "makefile.variables.names"></a>9.1.1.&nbsp;Naming
1.27      rillig   7106:                   conventions</h3>
                   7107:                 </div>
                   7108:               </div>
                   7109:             </div>
                   7110: 
                   7111:             <div class="itemizedlist">
                   7112:               <ul type="disc">
                   7113:                 <li>
                   7114:                   <p>All variable names starting with an underscore
                   7115:                   are reserved for use by the pkgsrc
                   7116:                   infrastructure. They shall not be used by package
1.45      wiz      7117:                   <code xmlns=
                   7118:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   7119:                   "filename">Makefile</code>s.</p>
1.27      rillig   7120:                 </li>
                   7121: 
                   7122:                 <li>
                   7123:                   <p>In <span><strong class=
                   7124:                   "command">.for</strong></span> loops you should
                   7125:                   use lowercase variable names for the iteration
                   7126:                   variables.</p>
                   7127:                 </li>
                   7128: 
                   7129:                 <li>
                   7130:                   <p>All list variables should have a ``plural''
                   7131:                   name, e.g. <code class=
                   7132:                   "varname">PKG_OPTIONS</code> or <code class=
                   7133:                   "varname">DISTFILES</code>.</p>
                   7134:                 </li>
                   7135:               </ul>
                   7136:             </div>
                   7137:           </div>
                   7138:         </div>
                   7139: 
1.52      tv       7140:         <div class="sect1" lang="en">
1.27      rillig   7141:           <div class="titlepage">
                   7142:             <div>
                   7143:               <div>
                   7144:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    7145:                 "makefile.code"></a>9.2.&nbsp;Code snippets</h2>
1.27      rillig   7146:               </div>
                   7147:             </div>
                   7148:           </div>
                   7149: 
                   7150:           <p>This section presents you with some code snippets you
                   7151:           should use in your own code. If you don't find anything
                   7152:           appropriate here, you should test your code and add it
                   7153:           here.</p>
                   7154: 
1.52      tv       7155:           <div class="sect2" lang="en">
1.27      rillig   7156:             <div class="titlepage">
                   7157:               <div>
                   7158:                 <div>
1.52      tv       7159:                   <h3 class="title"><a name=
1.38      dillo    7160:                   "adding-to-list"></a>9.2.1.&nbsp;Adding things to
1.30      wiz      7161:                   a list</h3>
1.27      rillig   7162:                 </div>
                   7163:               </div>
                   7164:             </div>
                   7165:             <pre class="programlisting">
1.51      rillig   7166:     STRING=                 foo * bar `date`
                   7167:     INT_LIST=               # empty
                   7168:     ANOTHER_INT_LIST=       apache-[0-9]*:../../www/apache
                   7169:     EXT_LIST=               # empty
                   7170:     ANOTHER_EXT_LIST=       a=b c=d
                   7171: 
                   7172:     INT_LIST+=              ${STRING}               # 1
                   7173:     INT_LIST+=              ${ANOTHER_INT_LIST}     # 2
                   7174:     EXT_LIST+=              ${STRING:Q}             # 3
                   7175:     EXT_LIST+=              ${ANOTHER_EXT_LIST}     # 4
1.27      rillig   7176: </pre>
                   7177: 
                   7178:             <p>When you add a string to an external list (example
                   7179:             3), it must be quoted. In all other cases, you must not
                   7180:             add a quoting level. You must not merge internal and
                   7181:             external lists, unless you are sure that all entries
                   7182:             are correctly interpreted in both lists.</p>
                   7183:           </div>
                   7184: 
1.52      tv       7185:           <div class="sect2" lang="en">
1.27      rillig   7186:             <div class="titlepage">
                   7187:               <div>
                   7188:                 <div>
1.30      wiz      7189:                   <h3 class="title"><a name=
1.38      dillo    7190:                   "converting-internal-to-external"></a>9.2.2.&nbsp;Converting
1.30      wiz      7191:                   an internal list into an external list</h3>
1.27      rillig   7192:                 </div>
                   7193:               </div>
                   7194:             </div>
                   7195:             <pre class="programlisting">
1.51      rillig   7196:     EXT_LIST=       # empty
                   7197:     .for i in ${INT_LIST}
                   7198:     EXT_LIST+=      ${i:Q}""
                   7199:     .endfor
1.27      rillig   7200: </pre>
                   7201: 
                   7202:             <p>This code converts the internal list <code class=
                   7203:             "varname">INT_LIST</code> into the external list
                   7204:             <code class="varname">EXT_LIST</code>. As the elements
                   7205:             of an internal list are unquoted they must be quoted
                   7206:             here. The reason for appending <code class=
                   7207:             "varname">""</code> is explained below.</p>
                   7208:           </div>
1.1       grant    7209: 
1.52      tv       7210:           <div class="sect2" lang="en">
1.27      rillig   7211:             <div class="titlepage">
1.1       grant    7212:               <div>
1.27      rillig   7213:                 <div>
1.30      wiz      7214:                   <h3 class="title"><a name=
1.38      dillo    7215:                   "passing-variable-to-shell"></a>9.2.3.&nbsp;Passing
1.30      wiz      7216:                   variables to a shell command</h3>
1.27      rillig   7217:                 </div>
1.1       grant    7218:               </div>
                   7219:             </div>
1.27      rillig   7220:             <pre class="programlisting">
1.51      rillig   7221:     STRING=         foo bar &lt;    &gt; * `date` $$HOME ' "
                   7222:     EXT_LIST=       string=${STRING:Q} x=second\ item
1.27      rillig   7223: 
1.51      rillig   7224:     all:
                   7225:             echo ${STRING}                  # 1
                   7226:             echo "${STRING}"                # 2
                   7227:             echo "${STRING:Q}"              # 3
                   7228:             echo ${STRING:Q}                # 4
                   7229:             echo x${STRING:Q} | sed 1s,.,,  # 5
                   7230:             env ${EXT_LIST} /bin/sh -c 'echo "$$string"; echo "$$x"'
1.27      rillig   7231: </pre>
                   7232: 
                   7233:             <p>Example 1 leads to a syntax error in the shell, as
                   7234:             the characters are just copied.</p>
                   7235: 
                   7236:             <p>Example 2 leads to a syntax error too, and if you
                   7237:             leave out the last " character from <code class=
                   7238:             "varname">${STRING}</code>, <a href=
                   7239:             "http://netbsd.gw.com/cgi-bin/man-cgi?date+1+NetBSD-current">
                   7240:             <span class="citerefentry"><span class=
                   7241:             "refentrytitle">date</span>(1)</span></a> will be
                   7242:             executed. The <code class="varname">$HOME</code> shell
                   7243:             variable would be evaluated, too.</p>
                   7244: 
                   7245:             <p>Example 3 outputs each space character preceded by a
                   7246:             backslash (or not), depending on the implementation of
                   7247:             the <a href=
                   7248:             "http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-current">
                   7249:             <span class="citerefentry"><span class=
                   7250:             "refentrytitle">echo</span>(1)</span></a> command.</p>
1.1       grant    7251: 
1.27      rillig   7252:             <p>Example 4 handles correctly every string that does
                   7253:             not start with a dash. In that case, the result depends
                   7254:             on the implementation of the <a href=
                   7255:             "http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-current">
                   7256:             <span class="citerefentry"><span class=
                   7257:             "refentrytitle">echo</span>(1)</span></a> command. As
                   7258:             long as you can guarantee that your input does not
1.47      reed     7259:             start with a dash, this form is appropriate.</p>
1.1       grant    7260: 
1.27      rillig   7261:             <p>Example 5 handles even the case of a leading dash
                   7262:             correctly.</p>
1.1       grant    7263: 
1.27      rillig   7264:             <p>The <code class="varname">EXT_LIST</code> does not
1.47      reed     7265:             need to be quoted because the quoting has already been
1.27      rillig   7266:             done when adding elements to the list.</p>
1.1       grant    7267: 
1.27      rillig   7268:             <p>As internal lists shall not be passed to the shell,
                   7269:             there is no example for it.</p>
1.1       grant    7270:           </div>
                   7271: 
1.52      tv       7272:           <div class="sect2" lang="en">
1.27      rillig   7273:             <div class="titlepage">
1.1       grant    7274:               <div>
1.27      rillig   7275:                 <div>
1.52      tv       7276:                   <h3 class="title"><a name=
1.38      dillo    7277:                   "quoting-guideline"></a>9.2.4.&nbsp;Quoting
1.27      rillig   7278:                   guideline</h3>
                   7279:                 </div>
1.1       grant    7280:               </div>
                   7281:             </div>
                   7282: 
1.27      rillig   7283:             <p>There are many possible sources of wrongly quoted
                   7284:             variables. This section lists some of the commonly
                   7285:             known ones.</p>
1.1       grant    7286: 
1.27      rillig   7287:             <div class="itemizedlist">
                   7288:               <ul type="disc">
                   7289:                 <li>
                   7290:                   <p>Whenever you use the value of a list, think
                   7291:                   about what happens to leading or trailing
                   7292:                   whitespace. If the list is a well-formed shell
1.47      reed     7293:                   expression, you can apply the <code class=
1.27      rillig   7294:                   "varname">:M*</code> modifier to strip leading
                   7295:                   and trailing whitespace from each word. The
                   7296:                   <code class="varname">:M</code> operator first
                   7297:                   splits its argument according to the rules of the
                   7298:                   shell, and then creates a new list consisting of
                   7299:                   all words that match the shell glob expression
                   7300:                   <code class="varname">*</code>, that is: all. One
                   7301:                   class of situations where this is needed is when
                   7302:                   adding a variable like <code class=
                   7303:                   "varname">CPPFLAGS</code> to <code class=
                   7304:                   "varname">CONFIGURE_ARGS</code>. If the configure
1.47      reed     7305:                   script invokes other configure scripts, it strips
1.27      rillig   7306:                   the leading and trailing whitespace from the
                   7307:                   variable and then passes it to the other
                   7308:                   configure scripts. But these configure scripts
                   7309:                   expect the (child) <code class=
                   7310:                   "varname">CPPFLAGS</code> variable to be the same
                   7311:                   as the parent <code class=
                   7312:                   "varname">CPPFLAGS</code>. That's why we better
                   7313:                   pass the <code class="varname">CPPFLAGS</code>
                   7314:                   value properly trimmed. And here is how we do
                   7315:                   it:</p>
                   7316:                   <pre class="programlisting">
1.51      rillig   7317:     CPPFLAGS=               # empty
                   7318:     CPPFLAGS+=              -Wundef -DPREFIX=\"${PREFIX:Q}\"
                   7319:     CPPFLAGS+=              ${MY_CPPFLAGS}
                   7320: 
                   7321:     CONFIGURE_ARGS+=        CPPFLAGS=${CPPFLAGS:M*:Q}
                   7322: 
                   7323:     all:
                   7324:             echo x${CPPFLAGS:Q}x            # leading and trailing whitespace
                   7325:             echo x${CONFIGURE_ARGS}x        # properly trimmed
1.27      rillig   7326: </pre>
                   7327:                 </li>
1.1       grant    7328: 
1.27      rillig   7329:                 <li>
                   7330:                   <p>The example above contains one bug: The
                   7331:                   <code class="varname">${PREFIX}</code> is a
                   7332:                   properly quoted shell expression, but there is
                   7333:                   the C compiler after it, which also expects a
                   7334:                   properly quoted string (this time in C syntax).
                   7335:                   The version above is therefore only correct if
                   7336:                   <code class="varname">${PREFIX}</code> does not
                   7337:                   have embedded backslashes or double quotes. If
                   7338:                   you want to allow these, you have to add another
                   7339:                   layer of quoting to each variable that is used as
                   7340:                   a C string literal. You cannot use the
                   7341:                   <code class="varname">:Q</code> operator for it,
                   7342:                   as this operator only works for the shell.</p>
                   7343:                 </li>
1.1       grant    7344: 
1.27      rillig   7345:                 <li>
1.47      reed     7346:                   <p>Whenever a variable can be empty, the
1.27      rillig   7347:                   <code class="varname">:Q</code> operator can have
                   7348:                   surprising results. Here are two completely
                   7349:                   different cases which can be solved with the same
                   7350:                   trick.</p>
                   7351:                   <pre class="programlisting">
1.51      rillig   7352:     EMPTY=                  # empty
                   7353:     empty_test:
                   7354:             for i in a ${EMPTY:Q} c; do \
                   7355:                     echo "$$i"; \
                   7356:             done
                   7357: 
                   7358:     for_test:
                   7359:     .for i in a:\ a:\test.txt
                   7360:             echo ${i:Q}
                   7361:             echo "foo"
                   7362:     .endfor
1.1       grant    7363: </pre>
                   7364: 
1.27      rillig   7365:                   <p>The first example will only print two of the
                   7366:                   three lines we might have expected. This is
                   7367:                   because <code class="varname">${EMPTY:Q}</code>
                   7368:                   expands to the empty string, which the shell
                   7369:                   cannot see. The workaround is to write
                   7370:                   <code class="varname">${EMPTY:Q}""</code>. This
                   7371:                   pattern can be often found as <code class=
                   7372:                   "varname">${TEST} -z ${VAR:Q}</code> or as
                   7373:                   <code class="varname">${TEST} -f
                   7374:                   ${FNAME:Q}</code> (both of these are wrong).</p>
                   7375: 
                   7376:                   <p>The second example will only print three lines
                   7377:                   instead of four. The first line looks like
                   7378:                   <code class="varname">a:\ echo foo</code>. This
                   7379:                   is because the backslash of the value
                   7380:                   <code class="varname">a:\</code> is interpreted
                   7381:                   as a line-continuation by <a href=
                   7382:                   "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current">
                   7383:                   <span class="citerefentry"><span class=
                   7384:                   "refentrytitle">make</span>(1)</span></a>, which
                   7385:                   makes the second line the arguments of the
                   7386:                   <a href=
                   7387:                   "http://netbsd.gw.com/cgi-bin/man-cgi?echo+1+NetBSD-current">
                   7388:                   <span class="citerefentry"><span class=
                   7389:                   "refentrytitle">echo</span>(1)</span></a> command
                   7390:                   from the first line. To avoid this, write
                   7391:                   <code class="varname">${i:Q}""</code>.</p>
                   7392:                 </li>
                   7393:               </ul>
                   7394:             </div>
1.1       grant    7395:           </div>
                   7396: 
1.52      tv       7397:           <div class="sect2" lang="en">
1.27      rillig   7398:             <div class="titlepage">
1.1       grant    7399:               <div>
1.27      rillig   7400:                 <div>
1.30      wiz      7401:                   <h3 class="title"><a name=
1.38      dillo    7402:                   "bsd-make-bug-workaround"></a>9.2.5.&nbsp;Workaround
1.30      wiz      7403:                   for a bug in BSD Make</h3>
1.27      rillig   7404:                 </div>
1.1       grant    7405:               </div>
                   7406:             </div>
                   7407: 
1.27      rillig   7408:             <p>The pkgsrc bmake program does not handle the
                   7409:             following assignment correctly. In case <code class=
                   7410:             "varname">_othervar_</code> contains a ``-'' character,
                   7411:             one of the closing braces is included in <code class=
                   7412:             "varname">${VAR}</code> after this code executes.</p>
                   7413:             <pre class="programlisting">
1.51      rillig   7414:     VAR:=   ${VAR:N${_othervar_:C/-//}}
1.1       grant    7415: </pre>
                   7416: 
1.27      rillig   7417:             <p>For a more complex code snippet and a workaround,
                   7418:             see the package <a xmlns=
                   7419:             "http://www.w3.org/TR/xhtml1/transitional" href=
                   7420:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/regress/make-quoting/README.html"
1.45      wiz      7421:             target="_top"><code xmlns="" class=
                   7422:             "filename">regress/make-quoting</code></a>, testcase
1.27      rillig   7423:             <code class="varname">bug1</code>.</p>
1.1       grant    7424:           </div>
                   7425:         </div>
                   7426:       </div>
                   7427: 
1.52      tv       7428:       <div class="chapter" lang="en">
1.1       grant    7429:         <div class="titlepage">
                   7430:           <div>
                   7431:             <div>
1.52      tv       7432:               <h2 class="title"><a name=
1.38      dillo    7433:               "plist"></a>Chapter&nbsp;10.&nbsp;PLIST issues</h2>
1.1       grant    7434:             </div>
                   7435:           </div>
                   7436:         </div>
                   7437: 
                   7438:         <div class="toc">
                   7439:           <p><b>Table of Contents</b></p>
                   7440: 
                   7441:           <dl>
1.38      dillo    7442:             <dt><span class="sect1"><a href="#rcs-id">10.1. RCS
1.1       grant    7443:             ID</a></span></dt>
                   7444: 
1.30      wiz      7445:             <dt><span class="sect1"><a href=
1.38      dillo    7446:             "#automatic-plist-generation">10.2. Semi-automatic
1.45      wiz      7447:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   7448:             class="filename">PLIST</code>
1.14      xtraeme  7449:             generation</a></span></dt>
1.1       grant    7450: 
1.38      dillo    7451:             <dt><span class="sect1"><a href="#print-PLIST">10.3.
1.14      xtraeme  7452:             Tweaking output of <span><strong class="command">make
                   7453:             print-PLIST</strong></span></a></span></dt>
1.1       grant    7454: 
1.38      dillo    7455:             <dt><span class="sect1"><a href="#plist.misc">10.4.
1.1       grant    7456:             Variable substitution in PLIST</a></span></dt>
                   7457: 
1.30      wiz      7458:             <dt><span class="sect1"><a href=
1.48      dillo    7459:             "#manpage-compression">10.5. Man page
                   7460:             compression</a></span></dt>
1.1       grant    7461: 
1.38      dillo    7462:             <dt><span class="sect1"><a href=
                   7463:             "#using-PLIST_SRC">10.6. Changing PLIST source with
                   7464:             <code class="varname">PLIST_SRC</code></a></span></dt>
1.1       grant    7465: 
1.30      wiz      7466:             <dt><span class="sect1"><a href=
1.47      reed     7467:             "#platform-specific-plist">10.7. Platform-specific and
1.30      wiz      7468:             differing PLISTs</a></span></dt>
1.1       grant    7469: 
1.38      dillo    7470:             <dt><span class="sect1"><a href=
                   7471:             "#faq.common-dirs">10.8. Sharing directories between
                   7472:             packages</a></span></dt>
1.1       grant    7473:           </dl>
                   7474:         </div>
                   7475: 
1.45      wiz      7476:         <p>The <code xmlns=
                   7477:         "http://www.w3.org/TR/xhtml1/transitional" class=
                   7478:         "filename">PLIST</code> file contains a package's
                   7479:         &#8220;<span class="quote">packing list</span>&#8221;, i.e.
                   7480:         a list of files that belong to the package (relative to the
                   7481:         <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   7482:         class="filename">${PREFIX}</code> directory it's been
                   7483:         installed in) plus some additional statements - see the
                   7484:         <a href=
1.1       grant    7485:         "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_create+1+NetBSD-current">
                   7486:         <span class="citerefentry"><span class=
1.47      reed     7487:         "refentrytitle">pkg_create</span>(1)</span></a> man page
                   7488:         for a full list. This chapter addresses some issues that
                   7489:         need attention when dealing with the <code xmlns=
1.45      wiz      7490:         "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  7491:         "filename">PLIST</code> file (or files, see below!).</p>
1.1       grant    7492: 
1.52      tv       7493:         <div class="sect1" lang="en">
1.1       grant    7494:           <div class="titlepage">
                   7495:             <div>
                   7496:               <div>
                   7497:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       7498:                 "rcs-id"></a>10.1.&nbsp;RCS ID</h2>
1.1       grant    7499:               </div>
                   7500:             </div>
                   7501:           </div>
                   7502: 
                   7503:           <p>Be sure to add a RCS ID line as the first thing in any
1.45      wiz      7504:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   7505:           class="filename">PLIST</code> file you write:</p>
1.1       grant    7506:           <pre class="programlisting">
1.51      rillig   7507:     @comment $NetBSD$
1.1       grant    7508: </pre>
                   7509:         </div>
                   7510: 
1.52      tv       7511:         <div class="sect1" lang="en">
1.1       grant    7512:           <div class="titlepage">
                   7513:             <div>
                   7514:               <div>
                   7515:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    7516:                 "automatic-plist-generation"></a>10.2.&nbsp;Semi-automatic
1.45      wiz      7517:                 <code xmlns=
                   7518:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   7519:                 "filename">PLIST</code> generation</h2>
1.1       grant    7520:               </div>
                   7521:             </div>
                   7522:           </div>
                   7523: 
1.14      xtraeme  7524:           <p>You can use the <span><strong class="command">make
                   7525:           print-PLIST</strong></span> command to output a PLIST
                   7526:           that matches any new files since the package was
                   7527:           extracted. See <a href="#build.helpful-targets" title=
1.38      dillo    7528:           "14.3.&nbsp;Other helpful targets">Section&nbsp;14.3,
1.1       grant    7529:           &#8220;Other helpful targets&#8221;</a> for more
                   7530:           information on this target.</p>
                   7531:         </div>
                   7532: 
1.52      tv       7533:         <div class="sect1" lang="en">
1.1       grant    7534:           <div class="titlepage">
                   7535:             <div>
                   7536:               <div>
                   7537:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    7538:                 "print-PLIST"></a>10.3.&nbsp;Tweaking output of
1.14      xtraeme  7539:                 <span><strong class="command">make
                   7540:                 print-PLIST</strong></span></h2>
1.1       grant    7541:               </div>
                   7542:             </div>
                   7543:           </div>
                   7544: 
                   7545:           <p>If you have used any of the *-dirs packages, as
                   7546:           explained in <a href="#faq.common-dirs" title=
1.38      dillo    7547:           "10.8.&nbsp;Sharing directories between packages">Section&nbsp;10.8,
1.1       grant    7548:           &#8220;Sharing directories between packages&#8221;</a>,
1.14      xtraeme  7549:           you may have noticed that <span><strong class=
                   7550:           "command">make print-PLIST</strong></span> outputs a set
                   7551:           of <code class="varname">@comment</code>s instead of real
                   7552:           <code class="varname">@dirrm</code> lines. You can also
                   7553:           do this for specific directories and files, so that the
                   7554:           results of that command are very close to reality. This
                   7555:           helps <span class="emphasis"><em>a lot</em></span> during
                   7556:           the update of packages.</p>
                   7557: 
                   7558:           <p>The <code class="varname">PRINT_PLIST_AWK</code>
                   7559:           variable takes a set of AWK patterns and actions that are
                   7560:           used to filter the output of print-PLIST. You can
                   7561:           <span class="emphasis"><em>append</em></span> any chunk
                   7562:           of AWK scripting you like to it, but be careful with
1.1       grant    7563:           quoting.</p>
                   7564: 
1.45      wiz      7565:           <p>For example, to get all files inside the <code xmlns=
                   7566:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  7567:           "filename">libdata/foo</code> directory removed from the
1.1       grant    7568:           resulting PLIST:</p>
                   7569:           <pre class="programlisting">
1.51      rillig   7570:     PRINT_PLIST_AWK+=       /^libdata\/foo/ { next; }
1.1       grant    7571: </pre>
                   7572: 
1.14      xtraeme  7573:           <p>And to get all the <code class="varname">@dirrm</code>
1.1       grant    7574:           lines referring to a specific (shared) directory
1.14      xtraeme  7575:           converted to <code class="varname">@comment</code>s:</p>
1.1       grant    7576:           <pre class="programlisting">
1.51      rillig   7577:     PRINT_PLIST_AWK+=       /^@dirrm share\/specific/ { print "@comment " $$0; next; }
1.1       grant    7578: </pre>
                   7579:         </div>
                   7580: 
1.52      tv       7581:         <div class="sect1" lang="en">
1.1       grant    7582:           <div class="titlepage">
                   7583:             <div>
                   7584:               <div>
                   7585:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    7586:                 "plist.misc"></a>10.4.&nbsp;Variable substitution
                   7587:                 in PLIST</h2>
1.1       grant    7588:               </div>
                   7589:             </div>
                   7590:           </div>
                   7591: 
                   7592:           <p>A number of variables are substituted automatically in
                   7593:           PLISTs when a package is installed on a system. This
                   7594:           includes the following variables:</p>
                   7595: 
                   7596:           <div class="variablelist">
                   7597:             <dl>
1.14      xtraeme  7598:               <dt><span class="term"><code class=
                   7599:               "varname">${MACHINE_ARCH}</code>, <code class=
                   7600:               "varname">${MACHINE_GNU_ARCH}</code></span></dt>
1.1       grant    7601: 
                   7602:               <dd>
                   7603:                 <p>Some packages like emacs and perl embed
                   7604:                 information about which architecture they were
                   7605:                 built on into the pathnames where they install
1.47      reed     7606:                 their files. To handle this case, PLIST will be
1.1       grant    7607:                 preprocessed before actually used, and the symbol
1.14      xtraeme  7608:                 &#8220;<span class="quote"><code class=
                   7609:                 "varname">${MACHINE_ARCH}</code></span>&#8221; will
                   7610:                 be replaced by what <span><strong class=
                   7611:                 "command">uname -p</strong></span> gives. The same
                   7612:                 is done if the string <code class=
                   7613:                 "varname">${MACHINE_GNU_ARCH}</code> is embedded in
                   7614:                 PLIST somewhere - use this on packages that have
1.47      reed     7615:                 GNU autoconf-created configure scripts.</p>
1.1       grant    7616: 
                   7617:                 <div class="note" style=
                   7618:                 "margin-left: 0.5in; margin-right: 0.5in;">
                   7619:                   <h3 class="title">Legacy note</h3>
                   7620: 
                   7621:                   <p>There used to be a symbol &#8220;<span class=
1.14      xtraeme  7622:                   "quote"><code class=
                   7623:                   "varname">$ARCH</code></span>&#8221; that was
                   7624:                   replaced by the output of <span><strong class=
                   7625:                   "command">uname -m</strong></span>, but that's no
1.1       grant    7626:                   longer supported and has been removed.</p>
                   7627:                 </div>
                   7628:               </dd>
                   7629: 
1.14      xtraeme  7630:               <dt><span class="term"><code class=
                   7631:               "varname">${OPSYS}</code>, <code class=
                   7632:               "varname">${LOWER_OPSYS}</code>, <code class=
                   7633:               "varname">${OS_VERSION}</code></span></dt>
1.1       grant    7634: 
                   7635:               <dd>
                   7636:                 <p>Some packages want to embed the OS name and
                   7637:                 version into some paths. To do this, use these
1.45      wiz      7638:                 variables in the <code xmlns=
                   7639:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  7640:                 "filename">PLIST</code>:</p>
1.1       grant    7641: 
                   7642:                 <div class="itemizedlist">
                   7643:                   <ul type="disc">
                   7644:                     <li>
1.14      xtraeme  7645:                       <p><code class="varname">${OPSYS}</code> -
                   7646:                       output of &#8220;<span class=
                   7647:                       "quote"><span><strong class="command">uname
                   7648:                       -s</strong></span></span>&#8221;</p>
1.1       grant    7649:                     </li>
                   7650: 
                   7651:                     <li>
1.14      xtraeme  7652:                       <p><code class=
                   7653:                       "varname">${LOWER_OPSYS}</code> - lowercase
                   7654:                       common name (eg. &#8220;<span class=
                   7655:                       "quote">solaris</span>&#8221;)</p>
1.1       grant    7656:                     </li>
                   7657: 
                   7658:                     <li>
1.14      xtraeme  7659:                       <p><code class="varname">${OS_VERSION}</code>
                   7660:                       - &#8220;<span class=
                   7661:                       "quote"><span><strong class="command">uname
                   7662:                       -r</strong></span></span>&#8221;</p>
1.1       grant    7663:                     </li>
                   7664:                   </ul>
                   7665:                 </div>
                   7666:               </dd>
                   7667: 
1.14      xtraeme  7668:               <dt><span class="term"><code class=
                   7669:               "varname">${PKGLOCALEDIR}</code></span></dt>
1.1       grant    7670: 
                   7671:               <dd>
                   7672:                 <p>Packages that install locale files should list
                   7673:                 them in the PLIST as &#8220;<span class=
                   7674:                 "quote">${PKGLOCALEDIR}/locale/de/LC_MESSAGES/...</span>&#8221;
                   7675:                 instead of &#8220;<span class=
                   7676:                 "quote">share/locale/de/LC_MESSAGES/...</span>&#8221;.
                   7677:                 This properly handles the fact that different
                   7678:                 operating systems expect locale files to be either
1.45      wiz      7679:                 in <code xmlns=
                   7680:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   7681:                 "filename">share</code> or <code xmlns=
                   7682:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   7683:                 "filename">lib</code> by default.</p>
1.1       grant    7684:               </dd>
                   7685:             </dl>
                   7686:           </div>
                   7687: 
                   7688:           <p>For a complete list of values which are replaced by
1.45      wiz      7689:           default, please look in <code xmlns=
                   7690:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  7691:           "filename">bsd.pkg.mk</code> (and search for <span class=
1.1       grant    7692:           "emphasis"><em>PLIST_SUBST</em></span>).</p>
                   7693: 
                   7694:           <p>If you want to change other variables not listed
                   7695:           above, you can add variables and their expansions to this
1.14      xtraeme  7696:           variable in the following way, similar to <code class=
                   7697:           "varname">MESSAGE_SUBST</code> (see <a href=
1.1       grant    7698:           "#components.optional" title=
1.38      dillo    7699:           "8.5.&nbsp;Optional files">Section&nbsp;8.5,
1.1       grant    7700:           &#8220;Optional files&#8221;</a>):</p>
                   7701:           <pre class="programlisting">
1.51      rillig   7702:     PLIST_SUBST+=   SOMEVAR="somevalue"
1.1       grant    7703: </pre>
                   7704: 
                   7705:           <p>This replaces all occurrences of &#8220;<span class=
                   7706:           "quote">${SOMEVAR}</span>&#8221; in the PLIST with
                   7707:           &#8220;<span class="quote">somevalue</span>&#8221;.</p>
                   7708:         </div>
                   7709: 
1.52      tv       7710:         <div class="sect1" lang="en">
1.1       grant    7711:           <div class="titlepage">
                   7712:             <div>
                   7713:               <div>
                   7714:                 <h2 class="title" style="clear: both"><a name=
1.48      dillo    7715:                 "manpage-compression"></a>10.5.&nbsp;Man page
                   7716:                 compression</h2>
1.1       grant    7717:               </div>
                   7718:             </div>
                   7719:           </div>
                   7720: 
1.47      reed     7721:           <p>Man pages should be installed in compressed form if
1.45      wiz      7722:           <code class="varname">MANZ</code> is set (in <code xmlns=
                   7723:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  7724:           "filename">bsd.own.mk</code>), and uncompressed
1.45      wiz      7725:           otherwise. To handle this in the <code xmlns=
                   7726:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  7727:           "filename">PLIST</code> file, the suffix
                   7728:           &#8220;<span class="quote">.gz</span>&#8221; is
1.47      reed     7729:           appended/removed automatically for man pages according to
1.14      xtraeme  7730:           <code class="varname">MANZ</code> and <code class=
                   7731:           "varname">MANCOMPRESSED</code> being set or not, see
1.45      wiz      7732:           above for details. This modification of the <code xmlns=
                   7733:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  7734:           "filename">PLIST</code> file is done on a copy of it, not
1.45      wiz      7735:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   7736:           class="filename">PLIST</code> itself.</p>
1.1       grant    7737:         </div>
                   7738: 
1.52      tv       7739:         <div class="sect1" lang="en">
1.1       grant    7740:           <div class="titlepage">
                   7741:             <div>
                   7742:               <div>
                   7743:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    7744:                 "using-PLIST_SRC"></a>10.6.&nbsp;Changing PLIST
1.30      wiz      7745:                 source with <code class=
1.14      xtraeme  7746:                 "varname">PLIST_SRC</code></h2>
1.1       grant    7747:               </div>
                   7748:             </div>
                   7749:           </div>
                   7750: 
1.14      xtraeme  7751:           <p>To use one or more files as source for the
1.45      wiz      7752:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   7753:           class="filename">PLIST</code> used in generating the
                   7754:           binary package, set the variable <code class=
1.14      xtraeme  7755:           "varname">PLIST_SRC</code> to the names of that file(s).
1.24      wiz      7756:           The files are later concatenated using <a href=
                   7757:           "http://netbsd.gw.com/cgi-bin/man-cgi?cat+1+NetBSD-current">
                   7758:           <span class="citerefentry"><span class=
                   7759:           "refentrytitle">cat</span>(1)</span></a>, and order of
                   7760:           things is important.</p>
1.1       grant    7761:         </div>
                   7762: 
1.52      tv       7763:         <div class="sect1" lang="en">
1.1       grant    7764:           <div class="titlepage">
                   7765:             <div>
                   7766:               <div>
                   7767:                 <h2 class="title" style="clear: both"><a name=
1.47      reed     7768:                 "platform-specific-plist"></a>10.7.&nbsp;Platform-specific
                   7769:                 and differing PLISTs</h2>
1.1       grant    7770:               </div>
                   7771:             </div>
                   7772:           </div>
                   7773: 
                   7774:           <p>Some packages decide to install a different set of
                   7775:           files based on the operating system being used. These
                   7776:           differences can be automatically handled by using the
                   7777:           following files:</p>
                   7778: 
                   7779:           <div class="itemizedlist">
                   7780:             <ul type="disc">
                   7781:               <li>
1.45      wiz      7782:                 <p><code xmlns=
                   7783:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   7784:                 "filename">PLIST.common</code></p>
1.1       grant    7785:               </li>
                   7786: 
                   7787:               <li>
1.45      wiz      7788:                 <p><code xmlns=
                   7789:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   7790:                 "filename">PLIST.${OPSYS}</code></p>
1.1       grant    7791:               </li>
                   7792: 
                   7793:               <li>
1.45      wiz      7794:                 <p><code xmlns=
                   7795:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.21      ben      7796:                 "filename">PLIST.${MACHINE_ARCH}</code></p>
                   7797:               </li>
                   7798: 
                   7799:               <li>
1.45      wiz      7800:                 <p><code xmlns=
                   7801:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.21      ben      7802:                 "filename">PLIST.${OPSYS}-${MACHINE_ARCH}</code></p>
                   7803:               </li>
                   7804: 
                   7805:               <li>
1.45      wiz      7806:                 <p><code xmlns=
                   7807:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  7808:                 "filename">PLIST.common_end</code></p>
1.1       grant    7809:               </li>
                   7810:             </ul>
                   7811:           </div>
                   7812:         </div>
                   7813: 
1.52      tv       7814:         <div class="sect1" lang="en">
1.1       grant    7815:           <div class="titlepage">
                   7816:             <div>
                   7817:               <div>
                   7818:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    7819:                 "faq.common-dirs"></a>10.8.&nbsp;Sharing
                   7820:                 directories between packages</h2>
1.1       grant    7821:               </div>
                   7822:             </div>
                   7823:           </div>
                   7824: 
                   7825:           <p>A &#8220;<span class="quote">shared
                   7826:           directory</span>&#8221; is a directory where multiple
                   7827:           (and unrelated) packages install files. These directories
                   7828:           are problematic because you have to add special tricks in
                   7829:           the PLIST to conditionally remove them, or have some
                   7830:           centralized package handle them.</p>
                   7831: 
                   7832:           <p>Within pkgsrc, you'll find both approaches. If a
                   7833:           directory is shared by a few unrelated packages, it's
                   7834:           often not worth to add an extra package to remove it.
                   7835:           Therefore, one simply does:</p>
                   7836:           <pre class="programlisting">
1.51      rillig   7837:     @unexec ${RMDIR} %D/path/to/shared/directory 2&gt;/dev/null || ${TRUE}
1.1       grant    7838: </pre>
                   7839: 
                   7840:           <p>in the PLISTs of all affected packages, instead of the
                   7841:           regular "@dirrm" line.</p>
                   7842: 
                   7843:           <p>However, if the directory is shared across many
                   7844:           packages, two different solutions are available:</p>
                   7845: 
                   7846:           <div class="orderedlist">
                   7847:             <ol type="1">
                   7848:               <li>
                   7849:                 <p>If the packages have a common dependency, the
                   7850:                 directory can be removed in that. For example, see
                   7851:                 <a xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   7852:                 href=
                   7853:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/textproc/scrollkeeper/README.html"
1.45      wiz      7854:                 target="_top"><code xmlns="" class=
                   7855:                 "filename">textproc/scrollkeeper</code></a>, which
                   7856:                 removes the shared directory <code xmlns=
                   7857:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.20      ben      7858:                 "filename">share/omf</code>.</p>
1.1       grant    7859:               </li>
                   7860: 
                   7861:               <li>
                   7862:                 <p>If the packages using the directory are not
                   7863:                 related at all (they have no common dependencies),
                   7864:                 a *-dirs package is used.</p>
                   7865:               </li>
                   7866:             </ol>
                   7867:           </div>
                   7868: 
                   7869:           <p>From now on, we'll discuss the second solution. To get
                   7870:           an idea of the *-dirs packages available, issue:</p>
                   7871:           <pre class="programlisting">
1.51      rillig   7872:     <code class="prompt">%</code> cd .../pkgsrc
                   7873:     <code class="prompt">%</code> ls -d */*-dirs
1.1       grant    7874: </pre>
                   7875: 
                   7876:           <p>Their use from other packages is very simple. The
1.14      xtraeme  7877:           <code class="varname">USE_DIRS</code> variable takes a
                   7878:           list of package names (without the &#8220;<span class=
1.1       grant    7879:           "quote">-dirs</span>&#8221; part) together with the
                   7880:           required version number (always pick the latest one when
1.34      wiz      7881:           writing new packages).</p>
1.1       grant    7882: 
                   7883:           <p>For example, if a package installs files under
1.45      wiz      7884:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   7885:           class="filename">share/applications</code>, it should
                   7886:           have the following line in it:</p>
1.1       grant    7887:           <pre class="programlisting">
1.51      rillig   7888:     USE_DIRS+=      xdg-1.1
1.1       grant    7889: </pre>
                   7890: 
1.14      xtraeme  7891:           <p>After regenerating the PLIST using
                   7892:           <span><strong class="command">make
                   7893:           print-PLIST</strong></span>, you should get the right
                   7894:           (commented out) lines.</p>
1.1       grant    7895: 
1.47      reed     7896:           <p>Note that even if your package is using <code xmlns=
1.45      wiz      7897:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  7898:           "filename">$X11BASE</code>, it must not depend on the
1.1       grant    7899:           *-x11-dirs packages. Just specify the name without that
1.45      wiz      7900:           part and pkgsrc (in particular, <code xmlns=
                   7901:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  7902:           "filename">mk/dirs.mk</code>) will take care of it.</p>
1.1       grant    7903:         </div>
                   7904:       </div>
                   7905: 
1.52      tv       7906:       <div class="chapter" lang="en">
1.1       grant    7907:         <div class="titlepage">
                   7908:           <div>
                   7909:             <div>
1.52      tv       7910:               <h2 class="title"><a name=
1.38      dillo    7911:               "buildlink"></a>Chapter&nbsp;11.&nbsp;Buildlink
1.1       grant    7912:               methodology</h2>
                   7913:             </div>
                   7914:           </div>
                   7915:         </div>
                   7916: 
                   7917:         <div class="toc">
                   7918:           <p><b>Table of Contents</b></p>
                   7919: 
                   7920:           <dl>
1.30      wiz      7921:             <dt><span class="sect1"><a href=
1.38      dillo    7922:             "#converting-to-buildlink3">11.1. Converting packages
1.30      wiz      7923:             to use buildlink3</a></span></dt>
1.1       grant    7924: 
1.30      wiz      7925:             <dt><span class="sect1"><a href=
1.45      wiz      7926:             "#creating-buildlink3.mk">11.2. Writing <code xmlns=
                   7927:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.30      wiz      7928:             "filename">buildlink3.mk</code> files</a></span></dt>
1.1       grant    7929: 
                   7930:             <dd>
                   7931:               <dl>
1.25      rillig   7932:                 <dt><span class="sect2"><a href=
1.38      dillo    7933:                 "#anatomy-of-bl3">11.2.1. Anatomy of a
1.30      wiz      7934:                 buildlink3.mk file</a></span></dt>
1.1       grant    7935: 
1.25      rillig   7936:                 <dt><span class="sect2"><a href=
1.38      dillo    7937:                 "#updating-buildlink-depends">11.2.2. Updating
1.30      wiz      7938:                 <code class="varname">BUILDLINK_DEPENDS.<em class=
1.14      xtraeme  7939:                 "replaceable"><code>pkg</code></em></code> in
1.45      wiz      7940:                 <code xmlns=
                   7941:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   7942:                 "filename">buildlink3.mk</code>
1.1       grant    7943:                 files</a></span></dt>
                   7944:               </dl>
                   7945:             </dd>
                   7946: 
1.30      wiz      7947:             <dt><span class="sect1"><a href=
1.45      wiz      7948:             "#writing-builtin.mk">11.3. Writing <code xmlns=
                   7949:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.30      wiz      7950:             "filename">builtin.mk</code> files</a></span></dt>
1.1       grant    7951: 
                   7952:             <dd>
                   7953:               <dl>
1.25      rillig   7954:                 <dt><span class="sect2"><a href=
1.38      dillo    7955:                 "#anatomy-of-builtin.mk">11.3.1. Anatomy of a
1.45      wiz      7956:                 <code xmlns=
                   7957:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   7958:                 "filename">builtin.mk</code> file</a></span></dt>
1.1       grant    7959: 
1.25      rillig   7960:                 <dt><span class="sect2"><a href=
1.38      dillo    7961:                 "#native-or-pkgsrc-preference">11.3.2. Global
1.30      wiz      7962:                 preferences for native or pkgsrc
                   7963:                 software</a></span></dt>
1.1       grant    7964:               </dl>
                   7965:             </dd>
                   7966:           </dl>
                   7967:         </div>
                   7968: 
                   7969:         <p>Buildlink is a framework in pkgsrc that controls what
                   7970:         headers and libraries are seen by a package's configure and
                   7971:         build processes. This is implemented in a two step
                   7972:         process:</p>
                   7973: 
                   7974:         <div class="orderedlist">
                   7975:           <ol type="1">
                   7976:             <li>
                   7977:               <p>Symlink headers and libraries for dependencies
1.14      xtraeme  7978:               into <code class="varname">BUILDLINK_DIR</code>,
                   7979:               which by default is a subdirectory of <code class=
                   7980:               "varname">WRKDIR</code>.</p>
1.1       grant    7981:             </li>
                   7982: 
                   7983:             <li>
                   7984:               <p>Create wrapper scripts that are used in place of
1.14      xtraeme  7985:               the normal compiler tools that translate <code class=
                   7986:               "option">-I${LOCALBASE}/include</code> and
                   7987:               <code class="option">-L${LOCALBASE}/lib</code> into
                   7988:               references to <code class=
                   7989:               "varname">BUILDLINK_DIR</code>. The wrapper scripts
                   7990:               also make native compiler on some operating systems
                   7991:               look like GCC, so that packages that expect GCC won't
                   7992:               require modifications to build with those native
                   7993:               compilers.</p>
1.1       grant    7994:             </li>
                   7995:           </ol>
                   7996:         </div>
                   7997: 
                   7998:         <p>This normalizes the environment in which a package is
                   7999:         built so that the package may be built consistently despite
                   8000:         what other software may be installed. Please note that the
1.45      wiz      8001:         normal system header and library paths, e.g. <code xmlns=
                   8002:         "http://www.w3.org/TR/xhtml1/transitional" class=
                   8003:         "filename">/usr/include</code>, <code xmlns=
                   8004:         "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8005:         "filename">/usr/lib</code>, etc., are always searched --
1.1       grant    8006:         buildlink3 is designed to insulate the package build from
                   8007:         non-system-supplied software.</p>
                   8008: 
1.52      tv       8009:         <div class="sect1" lang="en">
1.1       grant    8010:           <div class="titlepage">
                   8011:             <div>
                   8012:               <div>
                   8013:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    8014:                 "converting-to-buildlink3"></a>11.1.&nbsp;Converting
1.30      wiz      8015:                 packages to use buildlink3</h2>
1.1       grant    8016:               </div>
                   8017:             </div>
                   8018:           </div>
                   8019: 
                   8020:           <p>The process of converting packages to use the
                   8021:           buildlink3 framework (&#8220;<span class=
                   8022:           "quote">bl3ifying</span>&#8221;) is fairly
                   8023:           straightforward. The things to keep in mind are:</p>
                   8024: 
                   8025:           <div class="orderedlist">
                   8026:             <ol type="1">
                   8027:               <li>
                   8028:                 <p>Ensure that the build always calls the wrapper
                   8029:                 scripts instead of the actual toolchain. Some
                   8030:                 packages are tricky, and the only way to know for
1.45      wiz      8031:                 sure is the check <code xmlns=
                   8032:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8033:                 "filename">${WRKDIR}/.work.log</code> to see if the
1.1       grant    8034:                 wrappers are being invoked.</p>
                   8035:               </li>
                   8036: 
                   8037:               <li>
1.14      xtraeme  8038:                 <p>Don't override <code class=
                   8039:                 "varname">PREFIX</code> from within the package
                   8040:                 Makefile, e.g. Java VMs, standalone shells, etc.,
1.45      wiz      8041:                 because the code to symlink files into <code xmlns=
                   8042:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8043:                 "filename">${BUILDLINK_DIR}</code> looks for files
1.1       grant    8044:                 relative to &#8220;<span class="quote">pkg_info -qp
1.14      xtraeme  8045:                 <em class=
                   8046:                 "replaceable"><code>pkgname</code></em></span>&#8221;.</p>
1.1       grant    8047:               </li>
                   8048: 
                   8049:               <li>
                   8050:                 <p>Remember that <span class=
1.45      wiz      8051:                 "emphasis"><em>only</em></span> the <code xmlns=
                   8052:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8053:                 "filename">buildlink3.mk</code> files that you list
1.1       grant    8054:                 in a package's Makefile are added as dependencies
                   8055:                 for that package.</p>
                   8056:               </li>
                   8057:             </ol>
                   8058:           </div>
                   8059: 
                   8060:           <p>If a dependency on a particular package is required
                   8061:           for its libraries and headers, then we replace:</p>
                   8062:           <pre class="programlisting">
1.51      rillig   8063:     DEPENDS+=   foo&gt;=1.1.0:../../category/foo
1.1       grant    8064: </pre>
                   8065: 
                   8066:           <p>with</p>
                   8067:           <pre class="programlisting">
1.51      rillig   8068:     .include "../../category/foo/buildlink3.mk"
1.1       grant    8069: </pre>
                   8070: 
1.47      reed     8071:           <p>The buildlink3.mk files usually define the required
                   8072:           dependencies. If you need a newer version of the
                   8073:           dependency when using buildlink3.mk files, then you can
                   8074:           define it in your Makefile; for example:</p>
                   8075:           <pre class="programlisting">
1.51      rillig   8076:     BUILDLINK_DEPENDS.foo+=   foo&gt;=1.1.0
                   8077:     .include "../../category/foo/buildlink3.mk"
1.47      reed     8078: </pre>
                   8079: 
1.45      wiz      8080:           <p>There are several <code xmlns=
                   8081:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   8082:           "filename">buildlink3.mk</code> files in <code xmlns=
                   8083:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8084:           "filename">pkgsrc/mk</code> that handle special package
1.1       grant    8085:           issues:</p>
                   8086: 
                   8087:           <div class="itemizedlist">
                   8088:             <ul type="disc">
                   8089:               <li>
1.45      wiz      8090:                 <p><code xmlns=
                   8091:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   8092:                 "filename">bdb.buildlink3.mk</code> chooses either
                   8093:                 the native or a pkgsrc Berkeley DB implementation
                   8094:                 based on the values of <code class=
1.14      xtraeme  8095:                 "varname">BDB_ACCEPTED</code> and <code class=
                   8096:                 "varname">BDB_DEFAULT</code>.</p>
1.1       grant    8097:               </li>
                   8098: 
                   8099:               <li>
1.45      wiz      8100:                 <p><code xmlns=
                   8101:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.47      reed     8102:                 "filename">curses.buildlink3.mk</code>: If the
1.14      xtraeme  8103:                 system comes with neither Curses nor NCurses, this
                   8104:                 will take care to install the <a xmlns=
                   8105:                 "http://www.w3.org/TR/xhtml1/transitional" href=
1.1       grant    8106:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/ncurses/README.html"
1.45      wiz      8107:                 target="_top"><code xmlns="" class=
                   8108:                 "filename">devel/ncurses</code></a> package.</p>
1.1       grant    8109:               </li>
                   8110: 
                   8111:               <li>
1.45      wiz      8112:                 <p><code xmlns=
                   8113:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   8114:                 "filename">krb5.buildlink3.mk</code> uses the value
                   8115:                 of <code class="varname">KRB5_ACCEPTED</code> to
                   8116:                 choose between adding a dependency on Heimdal or
                   8117:                 MIT-krb5 for packages that require a Kerberos 5
1.1       grant    8118:                 implementation.</p>
                   8119:               </li>
                   8120: 
                   8121:               <li>
1.45      wiz      8122:                 <p><code xmlns=
                   8123:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8124:                 "filename">motif.buildlink3.mk</code> checks for a
                   8125:                 system-provided Motif installation or adds a
                   8126:                 dependency on <a xmlns=
1.1       grant    8127:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   8128:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/lesstif/README.html"
1.45      wiz      8129:                 target="_top"><code xmlns="" class=
                   8130:                 "filename">x11/lesstif</code></a> or <a xmlns=
1.20      ben      8131:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   8132:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/openmotif/README.html"
1.45      wiz      8133:                 target="_top"><code xmlns="" class=
1.47      reed     8134:                 "filename">x11/openmotif</code></a>.</p>
1.1       grant    8135:               </li>
                   8136: 
                   8137:               <li>
1.45      wiz      8138:                 <p><code xmlns=
                   8139:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8140:                 "filename">ossaudio.buildlink3.mk</code> defines
                   8141:                 several variables that may be used by packages that
1.47      reed     8142:                 use the Open Sound System (OSS) API.</p>
1.1       grant    8143:               </li>
                   8144: 
                   8145:               <li>
1.45      wiz      8146:                 <p><code xmlns=
                   8147:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8148:                 "filename">pgsql.buildlink3.mk</code> will accept
                   8149:                 either Postgres 7.3 or 7.4, whichever is found
                   8150:                 installed. See the file for more information.</p>
1.1       grant    8151:               </li>
                   8152: 
                   8153:               <li>
1.45      wiz      8154:                 <p><code xmlns=
                   8155:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8156:                 "filename">pthread.buildlink3.mk</code> uses the
                   8157:                 value of <code class="varname">PTHREAD_OPTS</code>
                   8158:                 and checks for native pthreads or adds a dependency
                   8159:                 on <a xmlns=
1.1       grant    8160:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   8161:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/pth/README.html"
1.45      wiz      8162:                 target="_top"><code xmlns="" class=
1.47      reed     8163:                 "filename">devel/pth</code></a> as needed.</p>
1.1       grant    8164:               </li>
                   8165: 
                   8166:               <li>
1.45      wiz      8167:                 <p><code xmlns=
                   8168:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   8169:                 "filename">xaw.buildlink3.mk</code> uses the value
                   8170:                 of <code class="varname">XAW_TYPE</code> to choose
                   8171:                 a particular Athena widgets library.</p>
1.1       grant    8172:               </li>
                   8173:             </ul>
                   8174:           </div>
                   8175: 
1.45      wiz      8176:           <p>The comments in those <code xmlns=
                   8177:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8178:           "filename">buildlink3.mk</code> files provide a more
1.1       grant    8179:           complete description of how to use them properly.</p>
                   8180:         </div>
                   8181: 
1.52      tv       8182:         <div class="sect1" lang="en">
1.1       grant    8183:           <div class="titlepage">
                   8184:             <div>
                   8185:               <div>
                   8186:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    8187:                 "creating-buildlink3.mk"></a>11.2.&nbsp;Writing
1.45      wiz      8188:                 <code xmlns=
                   8189:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   8190:                 "filename">buildlink3.mk</code> files</h2>
1.1       grant    8191:               </div>
                   8192:             </div>
                   8193:           </div>
                   8194: 
1.45      wiz      8195:           <p>A package's <code xmlns=
                   8196:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8197:           "filename">buildlink3.mk</code> file is included by
                   8198:           Makefiles to indicate the need to compile and link
                   8199:           against header files and libraries provided by the
1.45      wiz      8200:           package. A <code xmlns=
                   8201:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   8202:           "filename">buildlink3.mk</code> file should always
                   8203:           provide enough information to add the correct type of
                   8204:           dependency relationship and include any other
                   8205:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   8206:           class="filename">buildlink3.mk</code> files that it needs
                   8207:           to find headers and libraries that it needs in turn.</p>
1.1       grant    8208: 
1.45      wiz      8209:           <p>To generate an initial <code xmlns=
                   8210:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8211:           "filename">buildlink3.mk</code> file for further editing,
1.1       grant    8212:           Rene Hexel's <a xmlns=
                   8213:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   8214:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/createbuildlink/README.html"
1.45      wiz      8215:           target="_top"><code xmlns="" class=
                   8216:           "filename">pkgtools/createbuildlink</code></a> package is
1.20      ben      8217:           highly recommended. For most packages, the following
                   8218:           command will generate a good starting point for
1.45      wiz      8219:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   8220:           class="filename">buildlink3.mk</code> files:</p>
1.1       grant    8221:           <pre class="screen">
1.14      xtraeme  8222: <code class="prompt">%</code> <strong class=
                   8223: "userinput"><code>cd pkgsrc/<em class=
                   8224: "replaceable"><code>category</code></em>/<em class=
                   8225: "replaceable"><code>pkgdir</code></em>
                   8226: <code class=
1.49      rillig   8227: "prompt">%</code> createbuildlink &gt;buildlink3.mk</code></strong>
1.1       grant    8228: </pre>
                   8229: 
1.52      tv       8230:           <div class="sect2" lang="en">
1.1       grant    8231:             <div class="titlepage">
                   8232:               <div>
                   8233:                 <div>
1.52      tv       8234:                   <h3 class="title"><a name=
                   8235:                   "anatomy-of-bl3"></a>11.2.1.&nbsp;Anatomy of a
1.25      rillig   8236:                   buildlink3.mk file</h3>
1.1       grant    8237:                 </div>
                   8238:               </div>
                   8239:             </div>
                   8240: 
1.45      wiz      8241:             <p>The following real-life example <code xmlns=
                   8242:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8243:             "filename">buildlink3.mk</code> is taken from
1.45      wiz      8244:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   8245:             class="filename">pkgsrc/graphics/tiff</code>:</p>
1.1       grant    8246:             <pre class="programlisting">
1.51      rillig   8247:     # $NetBSD: buildlink3.mk,v 1.7 2004/03/18 09:12:12 jlam Exp $
1.1       grant    8248: 
1.51      rillig   8249:     BUILDLINK_DEPTH:=       ${BUILDLINK_DEPTH}+
                   8250:     TIFF_BUILDLINK3_MK:=    ${TIFF_BUILDLINK3_MK}+
1.1       grant    8251: 
1.51      rillig   8252:     .if !empty(BUILDLINK_DEPTH:M+)
                   8253:     BUILDLINK_DEPENDS+=     tiff
                   8254:     .endif
1.1       grant    8255: 
1.51      rillig   8256:     BUILDLINK_PACKAGES:=    ${BUILDLINK_PACKAGES:Ntiff}
                   8257:     BUILDLINK_PACKAGES+=    tiff
1.1       grant    8258: 
1.51      rillig   8259:     .if !empty(TIFF_BUILDLINK3_MK:M+)
                   8260:     BUILDLINK_DEPENDS.tiff+=        tiff&gt;=3.6.1
                   8261:     BUILDLINK_PKGSRCDIR.tiff?=      ../../graphics/tiff
                   8262:     .endif  # TIFF_BUILDLINK3_MK
1.1       grant    8263: 
1.51      rillig   8264:     .include "../../devel/zlib/buildlink3.mk"
                   8265:     .include "../../graphics/jpeg/buildlink3.mk"
1.1       grant    8266: 
1.51      rillig   8267:     BUILDLINK_DEPTH:=       ${BUILDLINK_DEPTH:S/+$//}
1.1       grant    8268: </pre>
                   8269: 
1.14      xtraeme  8270:             <p>The header and footer manipulate <code class=
                   8271:             "varname">BUILDLINK_DEPTH</code>, which is common
1.45      wiz      8272:             across all <code xmlns=
                   8273:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   8274:             "filename">buildlink3.mk</code> files and is used to
                   8275:             track at what depth we are including <code xmlns=
                   8276:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   8277:             "filename">buildlink3.mk</code> files.</p>
1.1       grant    8278: 
                   8279:             <p>The first section controls if the dependency on
1.14      xtraeme  8280:             <em class="replaceable"><code>pkg</code></em> is added.
                   8281:             <code class="varname">BUILDLINK_DEPENDS</code> is the
1.1       grant    8282:             global list of packages for which dependencies are
                   8283:             added by buildlink3.</p>
                   8284: 
                   8285:             <p>The second section advises pkgsrc that the
1.45      wiz      8286:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   8287:             class="filename">buildlink3.mk</code> file for
1.14      xtraeme  8288:             <em class="replaceable"><code>pkg</code></em> has been
                   8289:             included at some point. <code class=
                   8290:             "varname">BUILDLINK_PACKAGES</code> is the global list
1.45      wiz      8291:             of packages for which <code xmlns=
                   8292:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8293:             "filename">buildlink3.mk</code> files have been
                   8294:             included. It must <span class=
                   8295:             "emphasis"><em>always</em></span> be appended to within
1.45      wiz      8296:             a <code xmlns=
                   8297:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   8298:             "filename">buildlink3.mk</code> file.</p>
1.1       grant    8299: 
                   8300:             <p>The third section is protected from multiple
1.14      xtraeme  8301:             inclusion and controls how the dependency on <em class=
                   8302:             "replaceable"><code>pkg</code></em> is added. Several
1.1       grant    8303:             important variables are set in the section:</p>
                   8304: 
                   8305:             <div class="itemizedlist">
                   8306:               <ul type="disc">
                   8307:                 <li>
1.14      xtraeme  8308:                   <p><code class=
                   8309:                   "varname">BUILDLINK_DEPENDS.<em class=
                   8310:                   "replaceable"><code>pkg</code></em></code> is the
                   8311:                   actual dependency recorded in the installed
                   8312:                   package; this should always be set using
                   8313:                   <span><strong class="command">+=</strong></span>
                   8314:                   to ensure that we're appending to any
                   8315:                   pre-existing list of values. This variable should
                   8316:                   be set to the first version of the package that
                   8317:                   had the last change in the major number of a
                   8318:                   shared library or that had a major API
                   8319:                   change.</p>
1.1       grant    8320:                 </li>
                   8321: 
                   8322:                 <li>
1.14      xtraeme  8323:                   <p><code class=
                   8324:                   "varname">BUILDLINK_PKGSRCDIR.<em class=
                   8325:                   "replaceable"><code>pkg</code></em></code> is the
                   8326:                   location of the <em class=
                   8327:                   "replaceable"><code>pkg</code></em> pkgsrc
1.47      reed     8328:                   directory.</p>
1.1       grant    8329:                 </li>
                   8330: 
                   8331:                 <li>
1.14      xtraeme  8332:                   <p><code class=
                   8333:                   "varname">BUILDLINK_DEPMETHOD.<em class=
                   8334:                   "replaceable"><code>pkg</code></em></code> (not
                   8335:                   shown above) controls whether we use <code class=
                   8336:                   "varname">BUILD_DEPENDS</code> or <code class=
                   8337:                   "varname">DEPENDS</code> to add the dependency on
                   8338:                   <em class="replaceable"><code>pkg</code></em>.
                   8339:                   The build dependency is selected by setting
                   8340:                   <code class=
                   8341:                   "varname">BUILDLINK_DEPMETHOD.<em class=
                   8342:                   "replaceable"><code>pkg</code></em></code> to
1.1       grant    8343:                   &#8220;<span class="quote">build</span>&#8221;.
                   8344:                   By default, the full dependency is used.</p>
                   8345:                 </li>
                   8346: 
                   8347:                 <li>
1.14      xtraeme  8348:                   <p><code class=
                   8349:                   "varname">BUILDLINK_INCDIRS.<em class=
                   8350:                   "replaceable"><code>pkg</code></em></code> and
                   8351:                   <code class=
1.52      tv       8352:                   "varname">BUILDLINK_LIBDIRS.<em class="replaceable"><code>pkg</code></em></code>
                   8353:                   (not shown above) are lists of subdirectories of
                   8354:                   <code xmlns=
1.45      wiz      8355:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8356:                   "filename">${BUILDLINK_PREFIX.<em class=
                   8357:                   "replaceable"><code>pkg</code></em>}</code> to
                   8358:                   add to the header and library search paths. These
1.1       grant    8359:                   default to &#8220;<span class=
                   8360:                   "quote">include</span>&#8221; and
                   8361:                   &#8220;<span class="quote">lib</span>&#8221;
                   8362:                   respectively.</p>
                   8363:                 </li>
                   8364: 
                   8365:                 <li>
1.14      xtraeme  8366:                   <p><code class=
                   8367:                   "varname">BUILDLINK_CPPFLAGS.<em class=
                   8368:                   "replaceable"><code>pkg</code></em></code> (not
                   8369:                   shown above) is the list of preprocessor flags to
                   8370:                   add to <code class="varname">CPPFLAGS</code>,
                   8371:                   which are passed on to the configure and build
                   8372:                   phases. The &#8220;<span class=
                   8373:                   "quote">-I</span>&#8221; option should be avoided
                   8374:                   and instead be handled using <code class=
                   8375:                   "varname">BUILDLINK_INCDIRS.<em class=
                   8376:                   "replaceable"><code>pkg</code></em></code> as
                   8377:                   above.</p>
1.1       grant    8378:                 </li>
                   8379:               </ul>
                   8380:             </div>
                   8381: 
                   8382:             <p>The following variables are all optionally defined
                   8383:             within this second section (protected against multiple
                   8384:             inclusion) and control which package files are
1.45      wiz      8385:             symlinked into <code xmlns=
                   8386:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8387:             "filename">${BUILDLINK_DIR}</code> and how their names
1.1       grant    8388:             are transformed during the symlinking:</p>
                   8389: 
                   8390:             <div class="itemizedlist">
                   8391:               <ul type="disc">
                   8392:                 <li>
1.14      xtraeme  8393:                   <p><code class=
                   8394:                   "varname">BUILDLINK_FILES.<em class=
                   8395:                   "replaceable"><code>pkg</code></em></code> (not
                   8396:                   shown above) is a shell glob pattern relative to
1.45      wiz      8397:                   <code xmlns=
                   8398:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8399:                   "filename">${BUILDLINK_PREFIX.<em class=
                   8400:                   "replaceable"><code>pkg</code></em>}</code> to be
1.45      wiz      8401:                   symlinked into <code xmlns=
                   8402:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8403:                   "filename">${BUILDLINK_DIR}</code>, e.g.
1.45      wiz      8404:                   <code xmlns=
                   8405:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   8406:                   "filename">include/*.h</code>.</p>
1.1       grant    8407:                 </li>
                   8408: 
                   8409:                 <li>
1.14      xtraeme  8410:                   <p><code class=
                   8411:                   "varname">BUILDLINK_FILES_CMD.<em class=
                   8412:                   "replaceable"><code>pkg</code></em></code> (not
                   8413:                   shown above) is a shell pipeline that outputs to
1.45      wiz      8414:                   stdout a list of files relative to <code xmlns=
                   8415:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8416:                   "filename">${BUILDLINK_PREFIX.<em class=
                   8417:                   "replaceable"><code>pkg</code></em>}</code>. The
1.1       grant    8418:                   resulting files are to be symlinked into
1.45      wiz      8419:                   <code xmlns=
                   8420:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   8421:                   "filename">${BUILDLINK_DIR}</code>. By default,
                   8422:                   this takes the <code xmlns=
                   8423:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8424:                   "filename">+CONTENTS</code> of a <em class=
                   8425:                   "replaceable"><code>pkg</code></em> and filters
                   8426:                   it through <code class=
                   8427:                   "varname">${BUILDLINK_CONTENTS_FILTER.<em class=
                   8428:                   "replaceable"><code>pkg</code></em>}</code>.</p>
1.1       grant    8429:                 </li>
                   8430: 
                   8431:                 <li>
1.14      xtraeme  8432:                   <p><code class=
                   8433:                   "varname">BUILDLINK_CONTENTS_FILTER.<em class=
                   8434:                   "replaceable"><code>pkg</code></em></code> (not
                   8435:                   shown above) is a filter command that filters
1.45      wiz      8436:                   <code xmlns=
                   8437:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   8438:                   "filename">+CONTENTS</code> input into a list of
                   8439:                   files relative to <code xmlns=
                   8440:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8441:                   "filename">${BUILDLINK_PREFIX.<em class=
                   8442:                   "replaceable"><code>pkg</code></em>}</code> on
                   8443:                   stdout. By default for overwrite packages,
                   8444:                   <code class=
                   8445:                   "varname">BUILDLINK_CONTENTS_FILTER.<em class=
                   8446:                   "replaceable"><code>pkg</code></em></code>
1.45      wiz      8447:                   outputs the contents of the <code xmlns=
                   8448:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   8449:                   "filename">include</code> and <code xmlns=
                   8450:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8451:                   "filename">lib</code> directories in the package
1.45      wiz      8452:                   <code xmlns=
                   8453:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   8454:                   "filename">+CONTENTS</code>, and for pkgviews
                   8455:                   packages, it outputs any libtool archives in
                   8456:                   <code xmlns=
                   8457:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   8458:                   "filename">lib</code> directories.</p>
1.1       grant    8459:                 </li>
                   8460: 
                   8461:                 <li>
1.14      xtraeme  8462:                   <p><code class=
                   8463:                   "varname">BUILDLINK_TRANSFORM.<em class=
                   8464:                   "replaceable"><code>pkg</code></em></code> (not
                   8465:                   shown above) is a list of sed arguments used to
1.1       grant    8466:                   transform the name of the source filename into a
1.14      xtraeme  8467:                   destination filename, e.g. <span><strong class=
1.1       grant    8468:                   "command">-e
1.14      xtraeme  8469:                   "s|/curses.h|/ncurses.h|g"</strong></span>.</p>
1.1       grant    8470:                 </li>
                   8471:               </ul>
                   8472:             </div>
                   8473: 
1.45      wiz      8474:             <p>The last section includes any <code xmlns=
                   8475:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8476:             "filename">buildlink3.mk</code> needed for <em class=
                   8477:             "replaceable"><code>pkg</code></em>'s library
1.45      wiz      8478:             dependencies. Including these <code xmlns=
                   8479:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8480:             "filename">buildlink3.mk</code> files means that the
                   8481:             headers and libraries for these dependencies are also
1.45      wiz      8482:             symlinked into <code xmlns=
                   8483:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8484:             "filename">${BUILDLINK_DIR}</code> whenever the
                   8485:             <em class="replaceable"><code>pkg</code></em>
1.45      wiz      8486:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   8487:             class="filename">buildlink3.mk</code> file is
1.14      xtraeme  8488:             included.</p>
1.1       grant    8489:           </div>
                   8490: 
1.52      tv       8491:           <div class="sect2" lang="en">
1.1       grant    8492:             <div class="titlepage">
                   8493:               <div>
                   8494:                 <div>
1.30      wiz      8495:                   <h3 class="title"><a name=
1.52      tv       8496:                   "updating-buildlink-depends"></a>11.2.2.&nbsp;Updating
1.30      wiz      8497:                   <code class=
1.52      tv       8498:                   "varname">BUILDLINK_DEPENDS.<em class="replaceable"><code>pkg</code></em></code>
                   8499:                   in <code xmlns=
1.45      wiz      8500:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.30      wiz      8501:                   "filename">buildlink3.mk</code> files</h3>
1.1       grant    8502:                 </div>
                   8503:               </div>
                   8504:             </div>
                   8505: 
                   8506:             <p>There are two situations that require increasing the
1.14      xtraeme  8507:             dependency listed in <code class=
                   8508:             "varname">BUILDLINK_DEPENDS.<em class=
                   8509:             "replaceable"><code>pkg</code></em></code> after a
                   8510:             package update:</p>
1.1       grant    8511: 
                   8512:             <div class="orderedlist">
                   8513:               <ol type="1">
                   8514:                 <li>
                   8515:                   <p>if the sonames (major number of the library
                   8516:                   version) of any installed shared libraries
1.47      reed     8517:                   change.</p>
1.1       grant    8518:                 </li>
                   8519: 
                   8520:                 <li>
                   8521:                   <p>if the API or interface to the header files
                   8522:                   change.</p>
                   8523:                 </li>
                   8524:               </ol>
                   8525:             </div>
                   8526: 
1.14      xtraeme  8527:             <p>In these cases, <code class=
                   8528:             "varname">BUILDLINK_DEPENDS.<em class=
                   8529:             "replaceable"><code>pkg</code></em></code> should be
                   8530:             adjusted to require at least the new package version.
                   8531:             In some cases, the packages that depend on this new
                   8532:             version may need their <code class=
                   8533:             "varname">PKGREVISION</code>s increased and, if they
1.45      wiz      8534:             have <code xmlns=
                   8535:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   8536:             "filename">buildlink3.mk</code> files, their
                   8537:             <code class="varname">BUILDLINK_DEPENDS.<em class=
                   8538:             "replaceable"><code>pkg</code></em></code> adjusted,
                   8539:             too. This is needed so that binary packages made using
                   8540:             it will require the correct package dependency and not
                   8541:             settle for an older one which will not contain the
                   8542:             necessary shared libraries.</p>
1.1       grant    8543: 
                   8544:             <p>Please take careful consideration before adjusting
1.14      xtraeme  8545:             <code class="varname">BUILDLINK_DEPENDS.<em class=
                   8546:             "replaceable"><code>pkg</code></em></code> as we don't
                   8547:             want to cause unneeded package deletions and rebuilds.
                   8548:             In many cases, new versions of packages work just fine
                   8549:             with older dependencies. See <a href="#dependencies"
1.52      tv       8550:             title=
                   8551:             "15.1.4.&nbsp;Handling dependencies">Section&nbsp;15.1.4,
                   8552:             &#8220;Handling dependencies&#8221;</a> for more
                   8553:             information about dependencies on other packages,
1.25      rillig   8554:             including the <code class=
                   8555:             "varname">BUILDLINK_RECOMMENDED</code> and <code class=
                   8556:             "varname">RECOMMENDED</code> definitions.</p>
1.1       grant    8557:           </div>
                   8558:         </div>
                   8559: 
1.52      tv       8560:         <div class="sect1" lang="en">
1.1       grant    8561:           <div class="titlepage">
                   8562:             <div>
                   8563:               <div>
                   8564:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    8565:                 "writing-builtin.mk"></a>11.3.&nbsp;Writing
1.45      wiz      8566:                 <code xmlns=
                   8567:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   8568:                 "filename">builtin.mk</code> files</h2>
1.1       grant    8569:               </div>
                   8570:             </div>
                   8571:           </div>
                   8572: 
                   8573:           <p>Some packages in pkgsrc install headers and libraries
                   8574:           that coincide with headers and libraries present in the
1.45      wiz      8575:           base system. Aside from a <code xmlns=
                   8576:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8577:           "filename">buildlink3.mk</code> file, these packages
1.45      wiz      8578:           should also include a <code xmlns=
                   8579:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8580:           "filename">builtin.mk</code> file that includes the
                   8581:           necessary checks to decide whether using the built-in
                   8582:           software or the pkgsrc software is appropriate.</p>
1.1       grant    8583: 
                   8584:           <p>The only requirements of a builtin.mk file for
1.14      xtraeme  8585:           <em class="replaceable"><code>pkg</code></em> are:</p>
1.1       grant    8586: 
                   8587:           <div class="orderedlist">
                   8588:             <ol type="1">
                   8589:               <li>
1.14      xtraeme  8590:                 <p>It should set <code class=
                   8591:                 "varname">USE_BUILTIN.<em class=
                   8592:                 "replaceable"><code>pkg</code></em></code> to
                   8593:                 either &#8220;<span class="quote">yes</span>&#8221;
                   8594:                 or &#8220;<span class="quote">no</span>&#8221;
                   8595:                 after it is included.</p>
1.1       grant    8596:               </li>
                   8597: 
                   8598:               <li>
                   8599:                 <p>It should <span class=
                   8600:                 "emphasis"><em>not</em></span> override any
1.14      xtraeme  8601:                 <code class="varname">USE_BUILTIN.<em class=
                   8602:                 "replaceable"><code>pkg</code></em></code> which is
1.45      wiz      8603:                 already set before the <code xmlns=
                   8604:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8605:                 "filename">builtin.mk</code> file is included.</p>
1.1       grant    8606:               </li>
                   8607: 
                   8608:               <li>
                   8609:                 <p>It should be written to allow multiple
                   8610:                 inclusion. This is <span class=
                   8611:                 "emphasis"><em>very</em></span> important and takes
1.45      wiz      8612:                 careful attention to <code xmlns=
                   8613:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8614:                 "filename">Makefile</code> coding.</p>
1.1       grant    8615:               </li>
                   8616:             </ol>
                   8617:           </div>
                   8618: 
1.52      tv       8619:           <div class="sect2" lang="en">
1.1       grant    8620:             <div class="titlepage">
                   8621:               <div>
                   8622:                 <div>
1.52      tv       8623:                   <h3 class="title"><a name=
1.38      dillo    8624:                   "anatomy-of-builtin.mk"></a>11.3.1.&nbsp;Anatomy
1.45      wiz      8625:                   of a <code xmlns=
                   8626:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   8627:                   "filename">builtin.mk</code> file</h3>
1.1       grant    8628:                 </div>
                   8629:               </div>
                   8630:             </div>
                   8631: 
                   8632:             <p>The following is the recommended template for
                   8633:             builtin.mk files:</p>
                   8634:             <pre class="programlisting">
1.51      rillig   8635:     .if !defined(IS_BUILTIN.foo)
                   8636:     #
                   8637:     # IS_BUILTIN.foo is set to "yes" or "no" depending on whether "foo"
                   8638:     # genuinely exists in the system or not.
                   8639:     #
                   8640:     IS_BUILTIN.foo?=        no
                   8641: 
                   8642:     # BUILTIN_PKG.foo should be set here if "foo" is built-in and its package
                   8643:     # version can be determined.
                   8644:     #
                   8645:     .  if !empty(IS_BUILTIN.foo:M[yY][eE][sS])
                   8646:     BUILTIN_PKG.foo?=       foo-1.0
                   8647:     .  endif
                   8648:     .endif  # IS_BUILTIN.foo
                   8649: 
                   8650:     .if !defined(USE_BUILTIN.foo)
                   8651:     USE_BUILTIN.foo?=       ${IS_BUILTIN.foo}
                   8652:     .  if defined(BUILTIN_PKG.foo)
                   8653:     .    for _depend_ in ${BUILDLINK_DEPENDS.foo}
                   8654:     .      if !empty(USE_BUILTIN.foo:M[yY][eE][sS])
                   8655:     USE_BUILTIN.foo!=                                                       \
                   8656:           if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.foo}; then     \
                   8657:                   ${ECHO} "yes";                                            \
                   8658:           else                                                              \
                   8659:                   ${ECHO} "no";                                             \
                   8660:           fi
                   8661:     .      endif
                   8662:     .    endfor
                   8663:     .  endif
                   8664:     .endif  # USE_BUILTIN.foo
                   8665: 
                   8666:     CHECK_BUILTIN.foo?=     no
                   8667:     .if !empty(CHECK_BUILTIN.foo:M[nN][oO])
                   8668:     #
                   8669:     # Here we place code that depends on whether USE_BUILTIN.foo is set to
                   8670:     # "yes" or "no".
                   8671:     #
                   8672:     .endif  # CHECK_BUILTIN.foo
1.1       grant    8673: </pre>
                   8674: 
1.14      xtraeme  8675:             <p>The first section sets <code class=
                   8676:             "varname">IS_BUILTIN.<em class=
                   8677:             "replaceable"><code>pkg</code></em></code> depending on
                   8678:             if <em class="replaceable"><code>pkg</code></em> really
                   8679:             exists in the base system. This should not be a base
                   8680:             system software with similar functionality to
                   8681:             <em class="replaceable"><code>pkg</code></em>; it
                   8682:             should only be &#8220;<span class=
                   8683:             "quote">yes</span>&#8221; if the actual package is
                   8684:             included as part of the base system. This variable is
1.45      wiz      8685:             only used internally within the <code xmlns=
                   8686:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8687:             "filename">builtin.mk</code> file.</p>
                   8688: 
                   8689:             <p>The second section sets <code class=
                   8690:             "varname">BUILTIN_PKG.<em class=
                   8691:             "replaceable"><code>pkg</code></em></code> to the
                   8692:             version of <em class=
                   8693:             "replaceable"><code>pkg</code></em> in the base system
                   8694:             if it exists (if <code class=
                   8695:             "varname">IS_BUILTIN.<em class=
                   8696:             "replaceable"><code>pkg</code></em></code> is
1.1       grant    8697:             &#8220;<span class="quote">yes</span>&#8221;). This
1.14      xtraeme  8698:             variable is only used internally within the
1.45      wiz      8699:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   8700:             class="filename">builtin.mk</code> file.</p>
1.1       grant    8701: 
1.14      xtraeme  8702:             <p>The third section sets <code class=
                   8703:             "varname">USE_BUILTIN.<em class=
                   8704:             "replaceable"><code>pkg</code></em></code> and is
                   8705:             <span class="emphasis"><em>required</em></span> in all
1.45      wiz      8706:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   8707:             class="filename">builtin.mk</code> files. The code in
                   8708:             this section must make the determination whether the
                   8709:             built-in software is adequate to satisfy the
                   8710:             dependencies listed in <code class=
1.14      xtraeme  8711:             "varname">BUILDLINK_DEPENDS.<em class=
                   8712:             "replaceable"><code>pkg</code></em></code>. This is
                   8713:             typically done by comparing <code class=
                   8714:             "varname">BUILTIN_PKG.<em class=
                   8715:             "replaceable"><code>pkg</code></em></code> against each
                   8716:             of the dependencies in <code class=
                   8717:             "varname">BUILDLINK_DEPENDS.<em class=
                   8718:             "replaceable"><code>pkg</code></em></code>.
                   8719:             <code class="varname">USE_BUILTIN.<em class=
                   8720:             "replaceable"><code>pkg</code></em></code> <span class=
1.1       grant    8721:             "emphasis"><em>must</em></span> be set to the correct
1.45      wiz      8722:             value by the end of the <code xmlns=
                   8723:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8724:             "filename">builtin.mk</code> file. Note that
                   8725:             <code class="varname">USE_BUILTIN.<em class=
                   8726:             "replaceable"><code>pkg</code></em></code> may be
1.1       grant    8727:             &#8220;<span class="quote">yes</span>&#8221; even if
1.14      xtraeme  8728:             <code class="varname">IS_BUILTIN.<em class=
                   8729:             "replaceable"><code>pkg</code></em></code> is
1.1       grant    8730:             &#8220;<span class="quote">no</span>&#8221; because we
                   8731:             may make the determination that the built-in version of
                   8732:             the software is similar enough to be used as a
                   8733:             replacement.</p>
                   8734: 
1.14      xtraeme  8735:             <p>The last section is guarded by <code class=
                   8736:             "varname">CHECK_BUILTIN.<em class=
                   8737:             "replaceable"><code>pkg</code></em></code>, and
                   8738:             includes code that uses the value of <code class=
                   8739:             "varname">USE_BUILTIN.<em class=
                   8740:             "replaceable"><code>pkg</code></em></code> set in the
                   8741:             previous section. This typically includes, e.g., adding
1.1       grant    8742:             additional dependency restrictions and listing
1.45      wiz      8743:             additional files to symlink into <code xmlns=
                   8744:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8745:             "filename">${BUILDLINK_DIR}</code> (via <code class=
                   8746:             "varname">BUILDLINK_FILES.<em class=
                   8747:             "replaceable"><code>pkg</code></em></code>).</p>
1.1       grant    8748:           </div>
                   8749: 
1.52      tv       8750:           <div class="sect2" lang="en">
1.1       grant    8751:             <div class="titlepage">
                   8752:               <div>
                   8753:                 <div>
1.30      wiz      8754:                   <h3 class="title"><a name=
1.38      dillo    8755:                   "native-or-pkgsrc-preference"></a>11.3.2.&nbsp;Global
1.30      wiz      8756:                   preferences for native or pkgsrc software</h3>
1.1       grant    8757:                 </div>
                   8758:               </div>
                   8759:             </div>
                   8760: 
                   8761:             <p>When building packages, it's possible to choose
                   8762:             whether to set a global preference for using either the
                   8763:             built-in (native) version or the pkgsrc version of
                   8764:             software to satisfy a dependency. This is controlled by
1.14      xtraeme  8765:             setting <code class="varname">PREFER_PKGSRC</code> and
                   8766:             <code class="varname">PREFER_NATIVE</code>. These
                   8767:             variables take values of either &#8220;<span class=
1.1       grant    8768:             "quote">yes</span>&#8221;, &#8220;<span class=
                   8769:             "quote">no</span>&#8221;, or a list of packages.
1.14      xtraeme  8770:             <code class="varname">PREFER_PKGSRC</code> tells pkgsrc
                   8771:             to use the pkgsrc versions of software, while
                   8772:             <code class="varname">PREFER_NATIVE</code> tells pkgsrc
                   8773:             to use the built-in versions. Preferences are
                   8774:             determined by the most specific instance of the package
                   8775:             in either <code class="varname">PREFER_PKGSRC</code> or
                   8776:             <code class="varname">PREFER_NATIVE</code>. If a
                   8777:             package is specified in neither or in both variables,
                   8778:             then <code class="varname">PREFER_PKGSRC</code> has
                   8779:             precedence over <code class=
                   8780:             "varname">PREFER_NATIVE</code>. For example, to require
                   8781:             using pkgsrc versions of software for all but the most
                   8782:             basic bits on a NetBSD system, you can set:</p>
1.1       grant    8783:             <pre class="programlisting">
1.51      rillig   8784:     PREFER_PKGSRC=  yes
                   8785:     PREFER_NATIVE=  getopt skey tcp_wrappers
1.1       grant    8786: </pre>
                   8787: 
                   8788:             <p>A package <span class=
1.45      wiz      8789:             "emphasis"><em>must</em></span> have a <code xmlns=
                   8790:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  8791:             "filename">builtin.mk</code> file to be listed in
                   8792:             <code class="varname">PREFER_NATIVE</code>, otherwise
                   8793:             it is simply ignored in that list.</p>
1.1       grant    8794:           </div>
                   8795:         </div>
                   8796:       </div>
                   8797: 
1.52      tv       8798:       <div class="chapter" lang="en">
1.1       grant    8799:         <div class="titlepage">
                   8800:           <div>
                   8801:             <div>
1.52      tv       8802:               <h2 class="title"><a name=
1.38      dillo    8803:               "pkginstall"></a>Chapter&nbsp;12.&nbsp;The pkginstall
1.35      jmmv     8804:               framework</h2>
1.1       grant    8805:             </div>
                   8806:           </div>
                   8807:         </div>
                   8808: 
                   8809:         <div class="toc">
                   8810:           <p><b>Table of Contents</b></p>
                   8811: 
                   8812:           <dl>
1.30      wiz      8813:             <dt><span class="sect1"><a href=
1.38      dillo    8814:             "#files-and-dirs-outside-prefix">12.1. Files and
1.35      jmmv     8815:             directories outside the installation
                   8816:             prefix</a></span></dt>
                   8817: 
                   8818:             <dd>
                   8819:               <dl>
                   8820:                 <dt><span class="sect2"><a href=
1.38      dillo    8821:                 "#dirs-outside-prefix">12.1.1. Directory
1.35      jmmv     8822:                 manipulation</a></span></dt>
                   8823: 
                   8824:                 <dt><span class="sect2"><a href=
1.38      dillo    8825:                 "#files-outside-prefix">12.1.2. File
1.35      jmmv     8826:                 manipulation</a></span></dt>
                   8827:               </dl>
                   8828:             </dd>
                   8829: 
1.38      dillo    8830:             <dt><span class="sect1"><a href="#conf-files">12.2.
1.35      jmmv     8831:             Configuration files</a></span></dt>
                   8832: 
                   8833:             <dd>
                   8834:               <dl>
                   8835:                 <dt><span class="sect2"><a href=
1.38      dillo    8836:                 "#conf-files-sysconfdir">12.2.1. How <code class=
1.35      jmmv     8837:                 "varname">PKG_SYSCONFDIR</code> is
                   8838:                 set</a></span></dt>
                   8839: 
                   8840:                 <dt><span class="sect2"><a href=
1.38      dillo    8841:                 "#conf-files-configure">12.2.2. Telling the
1.47      reed     8842:                 software where configuration files
1.35      jmmv     8843:                 are</a></span></dt>
                   8844: 
                   8845:                 <dt><span class="sect2"><a href=
1.38      dillo    8846:                 "#conf-files-patching">12.2.3. Patching
1.35      jmmv     8847:                 installations</a></span></dt>
                   8848: 
                   8849:                 <dt><span class="sect2"><a href=
1.38      dillo    8850:                 "#conf-files-disable">12.2.4. Disabling handling of
1.35      jmmv     8851:                 configuration files</a></span></dt>
                   8852:               </dl>
                   8853:             </dd>
                   8854: 
1.38      dillo    8855:             <dt><span class="sect1"><a href="#rcd-scripts">12.3.
1.35      jmmv     8856:             System startup scripts</a></span></dt>
                   8857: 
                   8858:             <dd>
                   8859:               <dl>
                   8860:                 <dt><span class="sect2"><a href=
1.38      dillo    8861:                 "#rcd-scripts-disable">12.3.1. Disabling handling
1.35      jmmv     8862:                 of system startup scripts</a></span></dt>
                   8863:               </dl>
                   8864:             </dd>
1.1       grant    8865: 
1.30      wiz      8866:             <dt><span class="sect1"><a href=
1.38      dillo    8867:             "#users-and-groups">12.4. System users and
1.35      jmmv     8868:             groups</a></span></dt>
                   8869: 
1.38      dillo    8870:             <dt><span class="sect1"><a href="#shells">12.5. System
1.35      jmmv     8871:             shells</a></span></dt>
                   8872: 
                   8873:             <dd>
                   8874:               <dl>
                   8875:                 <dt><span class="sect2"><a href=
1.38      dillo    8876:                 "#shells-disable">12.5.1. Disabling handling of
1.35      jmmv     8877:                 configuration files</a></span></dt>
                   8878:               </dl>
                   8879:             </dd>
1.1       grant    8880:           </dl>
                   8881:         </div>
                   8882: 
1.35      jmmv     8883:         <p>This chapter describes the framework known as
                   8884:         <code class="literal">pkginstall</code>, whose key features
                   8885:         are:</p>
                   8886: 
                   8887:         <div class="itemizedlist">
                   8888:           <ul type="disc">
                   8889:             <li>
                   8890:               <p>Generic installation and manipulation of
                   8891:               directories and files outside the pkgsrc-handled
                   8892:               tree, <code class="varname">LOCALBASE</code>.</p>
                   8893:             </li>
                   8894: 
                   8895:             <li>
                   8896:               <p>Automatic handling of configuration files during
                   8897:               installation, provided that packages are correctly
                   8898:               designed.</p>
                   8899:             </li>
                   8900: 
                   8901:             <li>
                   8902:               <p>Generation and installation of system startup
                   8903:               scripts.</p>
                   8904:             </li>
                   8905: 
                   8906:             <li>
                   8907:               <p>Registration of system users and groups.</p>
                   8908:             </li>
                   8909: 
                   8910:             <li>
                   8911:               <p>Registration of system shells.</p>
                   8912:             </li>
                   8913:           </ul>
                   8914:         </div>
                   8915: 
                   8916:         <p>The following sections inspect each of the above points
1.47      reed     8917:         in detail. Note that in order to use any of the described
1.35      jmmv     8918:         functionalities, you must add the following to your
1.45      wiz      8919:         package's <code xmlns=
                   8920:         "http://www.w3.org/TR/xhtml1/transitional" class=
                   8921:         "filename">Makefile</code>:</p>
1.35      jmmv     8922:         <pre class="programlisting">
1.51      rillig   8923:     USE_PKGINSTALL= YES
1.35      jmmv     8924: </pre>
                   8925: 
                   8926:         <p>You may be thinking that many of the things described
                   8927:         here could be easily done with simple code in the package's
                   8928:         post-installation target (<code class=
                   8929:         "literal">post-install</code>). <span class=
                   8930:         "emphasis"><em>This is incorrect</em></span>, as the code
                   8931:         in them is only executed when building from source.
                   8932:         Machines using binary packages could not benefit from it at
                   8933:         all (as the code itself could be unavailable). Therefore,
                   8934:         the only way to achieve any of the items described above is
                   8935:         by means of the installation scripts, which are
                   8936:         automatically generated by pkginstall.</p>
1.1       grant    8937: 
1.52      tv       8938:         <div class="sect1" lang="en">
1.1       grant    8939:           <div class="titlepage">
                   8940:             <div>
                   8941:               <div>
                   8942:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       8943:                 "files-and-dirs-outside-prefix"></a>12.1.&nbsp;Files
                   8944:                 and directories outside the installation
                   8945:                 prefix</h2>
1.1       grant    8946:               </div>
                   8947:             </div>
                   8948:           </div>
                   8949: 
1.45      wiz      8950:           <p>As you already know, the <code xmlns=
                   8951:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     8952:           "filename">PLIST</code> file holds a list of files and
                   8953:           directories that belong to a package. The names used in
1.45      wiz      8954:           it are relative to the installation prefix (<code xmlns=
                   8955:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     8956:           "filename">${PREFIX}</code>), which means that it cannot
                   8957:           register files outside this directory (absolute path
                   8958:           names are not allowed). Despite this restriction, some
                   8959:           packages need to install files outside this location;
1.45      wiz      8960:           e.g., under <code xmlns=
                   8961:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   8962:           "filename">${VARBASE}</code> or <code xmlns=
                   8963:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   8964:           "filename">${PKG_SYSCONFDIR}</code>.</p>
1.35      jmmv     8965: 
                   8966:           <p>The only way to achieve this is to create such files
                   8967:           during installation time by using the installation
                   8968:           scripts. These scripts can run arbitrary commands, so
                   8969:           they have the potential to create and manage files
1.47      reed     8970:           anywhere in the file system. Here is where pkginstall
1.35      jmmv     8971:           comes into play: it provides generic scripts to abstract
                   8972:           the manipulation of such files and directories based on
1.45      wiz      8973:           variables set in the package's <code xmlns=
                   8974:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     8975:           "filename">Makefile</code>. The rest of this section
1.47      reed     8976:           describes these variables.</p>
1.1       grant    8977: 
1.52      tv       8978:           <div class="sect2" lang="en">
1.35      jmmv     8979:             <div class="titlepage">
1.1       grant    8980:               <div>
1.35      jmmv     8981:                 <div>
1.52      tv       8982:                   <h3 class="title"><a name=
                   8983:                   "dirs-outside-prefix"></a>12.1.1.&nbsp;Directory
1.35      jmmv     8984:                   manipulation</h3>
                   8985:                 </div>
1.1       grant    8986:               </div>
                   8987:             </div>
                   8988: 
1.35      jmmv     8989:             <p>The following variables can be set to request the
1.47      reed     8990:             creation of directories anywhere in the file
                   8991:             system:</p>
1.27      rillig   8992: 
1.35      jmmv     8993:             <div class="itemizedlist">
                   8994:               <ul type="disc">
                   8995:                 <li>
                   8996:                   <p><code class="varname">MAKE_DIRS</code> and
                   8997:                   <code class="varname">OWN_DIRS</code> contain a
                   8998:                   list of directories that should be created and
                   8999:                   should attempt to be destroyed by the
                   9000:                   installation scripts. The difference between the
                   9001:                   two is that the latter prompts the administrator
                   9002:                   to remove any directories that may be left after
                   9003:                   deinstallation (because they were not empty),
                   9004:                   while the former does not.</p>
                   9005:                 </li>
1.1       grant    9006: 
1.35      jmmv     9007:                 <li>
                   9008:                   <p><code class="varname">MAKE_DIRS_PERMS</code>
                   9009:                   and <code class="varname">OWN_DIRS_PERMS</code>
                   9010:                   contain a list of tuples describing which
                   9011:                   directories should be created and should attempt
                   9012:                   to be destroyed by the installation scripts. Each
                   9013:                   tuple holds the following values, separated by
                   9014:                   spaces: the directory name, its owner, its group
                   9015:                   and its numerical mode. For example:</p>
                   9016:                   <pre class="programlisting">
1.51      rillig   9017:     MAKE_DIRS_PERMS+=         ${VARBASE}/foo/private ${ROOT_USER} ${ROOT_GROUP} 0700
1.35      jmmv     9018: </pre>
1.1       grant    9019: 
1.35      jmmv     9020:                   <p>The difference between the two is exactly the
                   9021:                   same as their non-<code class=
                   9022:                   "varname">PERMS</code> counterparts.</p>
                   9023:                 </li>
                   9024:               </ul>
                   9025:             </div>
                   9026:           </div>
                   9027: 
1.52      tv       9028:           <div class="sect2" lang="en">
1.35      jmmv     9029:             <div class="titlepage">
                   9030:               <div>
                   9031:                 <div>
1.52      tv       9032:                   <h3 class="title"><a name=
                   9033:                   "files-outside-prefix"></a>12.1.2.&nbsp;File
1.35      jmmv     9034:                   manipulation</h3>
                   9035:                 </div>
                   9036:               </div>
                   9037:             </div>
                   9038: 
                   9039:             <p>Creating non-empty files outside the installation
1.45      wiz      9040:             prefix is tricky because the <code xmlns=
                   9041:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9042:             "filename">PLIST</code> forces all files to be inside
                   9043:             it. To overcome this problem, the only solution is to
                   9044:             extract the file in the known place (i.e., inside the
                   9045:             installation prefix) and copy it to the appropriate
                   9046:             location during installation (done by the installation
                   9047:             scripts generated by pkginstall). We will call the
                   9048:             former the <span class="emphasis"><em>master
                   9049:             file</em></span> in the following paragraphs, which
                   9050:             describe the variables that can be used to
                   9051:             automatically and consistently handle files outside the
                   9052:             installation prefix:</p>
                   9053: 
                   9054:             <div class="itemizedlist">
                   9055:               <ul type="disc">
                   9056:                 <li>
                   9057:                   <p><code class="varname">CONF_FILES</code> and
                   9058:                   <code class="varname">SUPPORT_FILES</code> are
                   9059:                   pairs of master and target files. During
                   9060:                   installation time, the master file is copied to
                   9061:                   the target one if and only if the latter does not
                   9062:                   exist. Upon deinstallation, the target file is
                   9063:                   removed provided that it was not modified by the
                   9064:                   installation.</p>
                   9065: 
                   9066:                   <p>The difference between the two is that the
                   9067:                   latter prompts the administrator to remove any
                   9068:                   files that may be left after deinstallation
                   9069:                   (because they were not empty), while the former
                   9070:                   does not.</p>
                   9071:                 </li>
                   9072: 
                   9073:                 <li>
                   9074:                   <p><code class="varname">CONF_FILES_PERMS</code>
                   9075:                   and <code class=
                   9076:                   "varname">SUPPORT_FILES_PERMS</code> contain
                   9077:                   tuples describing master files as well as their
                   9078:                   target locations. For each of them, it also
                   9079:                   specifies their owner, their group and their
                   9080:                   numeric permissions, in this order. For
                   9081:                   example:</p>
                   9082:                   <pre class="programlisting">
1.51      rillig   9083:     SUPPORT_FILES_PERMS+= ${PREFIX}/share/somefile ${VARBASE}/somefile ${ROOT_USER} ${ROOT_GROUP} 0700
1.35      jmmv     9084: </pre>
                   9085: 
                   9086:                   <p>The difference between the two is exactly the
                   9087:                   same as their non-<code class=
                   9088:                   "varname">PERMS</code> counterparts.</p>
                   9089:                 </li>
                   9090:               </ul>
                   9091:             </div>
                   9092:           </div>
                   9093:         </div>
                   9094: 
1.52      tv       9095:         <div class="sect1" lang="en">
1.35      jmmv     9096:           <div class="titlepage">
                   9097:             <div>
                   9098:               <div>
                   9099:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       9100:                 "conf-files"></a>12.2.&nbsp;Configuration
                   9101:                 files</h2>
1.35      jmmv     9102:               </div>
                   9103:             </div>
                   9104:           </div>
                   9105: 
                   9106:           <p>Configuration files are special in the sense that they
                   9107:           are installed in their own specific directory,
                   9108:           <code class="varname">PKG_SYSCONFDIR</code>, and need
                   9109:           special treatment during installation (most of which is
                   9110:           automated by pkginstall). The main concept you must bear
1.36      wiz      9111:           in mind is that files marked as configuration files are
1.35      jmmv     9112:           automatically copied to the right place (somewhere inside
                   9113:           <code class="varname">PKG_SYSCONFDIR</code>) during
                   9114:           installation <span class="emphasis"><em>if and only
                   9115:           if</em></span> they didn't exist before. Similarly, they
                   9116:           will not be removed if they have local modifications.
1.36      wiz      9117:           This ensures that administrators never lose any custom
1.35      jmmv     9118:           changes they may have made.</p>
                   9119: 
1.52      tv       9120:           <div class="sect2" lang="en">
1.35      jmmv     9121:             <div class="titlepage">
                   9122:               <div>
                   9123:                 <div>
1.52      tv       9124:                   <h3 class="title"><a name=
                   9125:                   "conf-files-sysconfdir"></a>12.2.1.&nbsp;How
1.35      jmmv     9126:                   <code class="varname">PKG_SYSCONFDIR</code> is
                   9127:                   set</h3>
                   9128:                 </div>
                   9129:               </div>
                   9130:             </div>
                   9131: 
                   9132:             <p>As said before, the <code class=
                   9133:             "varname">PKG_SYSCONFDIR</code> variable specifies
                   9134:             where configuration files shall be installed. Its
                   9135:             contents are set based upon the following
                   9136:             variables:</p>
                   9137: 
                   9138:             <div class="itemizedlist">
                   9139:               <ul type="disc">
                   9140:                 <li>
                   9141:                   <p><code class="varname">PKG_SYSCONFBASE</code>:
                   9142:                   The configuration's root directory. Defaults to
1.45      wiz      9143:                   <code xmlns=
                   9144:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   9145:                   "filename">${PREFIX}/etc</code> although it may
                   9146:                   be overridden by the user to point to his
                   9147:                   preferred location (e.g., <code xmlns=
                   9148:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   9149:                   "filename">/etc</code>, <code xmlns=
                   9150:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9151:                   "filename">/etc/pkg</code>, etc.). Packages must
                   9152:                   not use it directly.</p>
                   9153:                 </li>
                   9154: 
                   9155:                 <li>
                   9156:                   <p><code class=
                   9157:                   "varname">PKG_SYSCONFSUBDIR</code>: A
                   9158:                   subdirectory of <code class=
                   9159:                   "varname">PKG_SYSCONFBASE</code> under which the
                   9160:                   configuration files for the package being built
                   9161:                   shall be installed. The definition of this
                   9162:                   variable only makes sense in the package's
1.45      wiz      9163:                   <code xmlns=
                   9164:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.47      reed     9165:                   "filename">Makefile</code> (i.e., it is not
                   9166:                   user-customizable).</p>
1.35      jmmv     9167: 
                   9168:                   <p>As an example, consider the Apache package,
                   9169:                   <a xmlns=
                   9170:                   "http://www.w3.org/TR/xhtml1/transitional" href=
                   9171:                   "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/apache2/README.html"
1.45      wiz      9172:                   target="_top"><code xmlns="" class=
                   9173:                   "filename">www/apache2</code></a>, which places
                   9174:                   its configuration files under the <code xmlns=
                   9175:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9176:                   "filename">httpd/</code> subdirectory of
                   9177:                   <code class="varname">PKG_SYSCONFBASE</code>.
                   9178:                   This should be set in the package Makefile.</p>
                   9179:                 </li>
                   9180: 
                   9181:                 <li>
                   9182:                   <p><code class="varname">PKG_SYSCONFVAR</code>:
                   9183:                   Specifies the name of the variable that holds
                   9184:                   this package's configuration directory (if
                   9185:                   different from <code class=
                   9186:                   "varname">PKG_SYSCONFBASE</code>). It defaults to
                   9187:                   <code class="varname">PKGBASE</code>'s value, and
                   9188:                   is always prefixed with <code class=
                   9189:                   "literal">PKG_SYSCONFDIR</code>.</p>
                   9190:                 </li>
                   9191: 
                   9192:                 <li>
                   9193:                   <p><code class=
                   9194:                   "varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code>:
                   9195:                   Holds the directory where the configuration files
                   9196:                   for the package identified by <code class=
                   9197:                   "varname">PKG_SYSCONFVAR</code>'s shall be
                   9198:                   placed.</p>
                   9199:                 </li>
                   9200:               </ul>
                   9201:             </div>
                   9202: 
                   9203:             <p>Based on the above variables, pkginstall determines
                   9204:             the value of <code class=
                   9205:             "varname">PKG_SYSCONFDIR</code>, which is the
                   9206:             <span class="emphasis"><em>only</em></span> variable
                   9207:             that can be used within a package to refer to its
                   9208:             configuration directory. The algorithm used to set its
                   9209:             value is basically the following:</p>
                   9210: 
                   9211:             <div class="orderedlist">
                   9212:               <ol type="1">
                   9213:                 <li>
                   9214:                   <p>If <code class=
                   9215:                   "varname">PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</code>
                   9216:                   is set, its value is used.</p>
                   9217:                 </li>
                   9218: 
                   9219:                 <li>
                   9220:                   <p>If the previous variable is not defined but
                   9221:                   <code class="varname">PKG_SYSCONFSUBDIR</code> is
1.45      wiz      9222:                   set in the package's <code xmlns=
                   9223:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9224:                   "filename">Makefile</code>, the resulting value
1.45      wiz      9225:                   is <code xmlns=
                   9226:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9227:                   "filename">${PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR}</code>.</p>
                   9228:                 </li>
                   9229: 
                   9230:                 <li>
1.45      wiz      9231:                   <p>Otherwise, it is set to <code xmlns=
                   9232:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9233:                   "filename">${PKG_SYSCONFBASE}</code>.</p>
                   9234:                 </li>
                   9235:               </ol>
                   9236:             </div>
                   9237: 
1.45      wiz      9238:             <p>It is worth mentioning that <code xmlns=
                   9239:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9240:             "filename">${PKG_SYSCONFDIR}</code> is automatically
1.45      wiz      9241:             added to <code xmlns=
                   9242:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   9243:             "filename">OWN_DIRS</code>. See <a href=
                   9244:             "#dirs-outside-prefix" title=
1.52      tv       9245:             "12.1.1.&nbsp;Directory manipulation">Section&nbsp;12.1.1,
1.35      jmmv     9246:             &#8220;Directory manipulation&#8221;</a> what this
                   9247:             means.</p>
                   9248:           </div>
                   9249: 
1.52      tv       9250:           <div class="sect2" lang="en">
1.35      jmmv     9251:             <div class="titlepage">
                   9252:               <div>
                   9253:                 <div>
1.52      tv       9254:                   <h3 class="title"><a name=
                   9255:                   "conf-files-configure"></a>12.2.2.&nbsp;Telling
                   9256:                   the software where configuration files are</h3>
1.35      jmmv     9257:                 </div>
                   9258:               </div>
                   9259:             </div>
                   9260: 
                   9261:             <p>Given that pkgsrc (and users!) expect configuration
                   9262:             files to be in a known place, you need to teach each
1.36      wiz      9263:             package where it shall install its files. In some cases
1.35      jmmv     9264:             you will have to patch the package Makefiles to achieve
                   9265:             it. If you are lucky, though, it may be as easy as
                   9266:             passing an extra flag to the configuration script; this
1.47      reed     9267:             is the case of GNU Autoconf- generated files:</p>
1.35      jmmv     9268:             <pre class="programlisting">
1.51      rillig   9269:     CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
1.35      jmmv     9270: </pre>
                   9271: 
                   9272:             <p>Note that this specifies where the package has to
                   9273:             <span class="emphasis"><em>look for</em></span> its
                   9274:             configuration files, not where they will be originally
                   9275:             installed (although the difference is never explicit,
                   9276:             unfortunately).</p>
                   9277:           </div>
                   9278: 
1.52      tv       9279:           <div class="sect2" lang="en">
1.35      jmmv     9280:             <div class="titlepage">
                   9281:               <div>
                   9282:                 <div>
1.52      tv       9283:                   <h3 class="title"><a name=
                   9284:                   "conf-files-patching"></a>12.2.3.&nbsp;Patching
1.35      jmmv     9285:                   installations</h3>
                   9286:                 </div>
                   9287:               </div>
                   9288:             </div>
                   9289: 
                   9290:             <p>As said before, pkginstall automatically handles
                   9291:             configuration files. This means that <span class=
                   9292:             "strong"><strong>the packages themselves must not touch
1.45      wiz      9293:             the contents of <code xmlns=
                   9294:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9295:             "filename">${PKG_SYSCONFDIR}</code>
1.36      wiz      9296:             directly</strong></span>. Bad news is that many
                   9297:             software installation scripts will, out of the box,
                   9298:             mess with the contents of that directory. So what is
                   9299:             the correct procedure to fix this issue?</p>
1.35      jmmv     9300: 
                   9301:             <p>You must teach the package (usually by manually
                   9302:             patching it) to install any configuration files under
1.45      wiz      9303:             the examples hierarchy, <code xmlns=
                   9304:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9305:             "filename">share/examples/${PKGBASE}/</code>. This way,
1.45      wiz      9306:             the <code xmlns=
                   9307:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   9308:             "filename">PLIST</code> registers them and the
                   9309:             administrator always has the original copies
1.35      jmmv     9310:             available.</p>
                   9311: 
                   9312:             <p>Once the required configuration files are in place
                   9313:             (i.e., under the examples hierarchy), the pkginstall
                   9314:             framework can use them as master copies during the
1.45      wiz      9315:             package installation to update what is in <code xmlns=
                   9316:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9317:             "filename">${PKG_SYSCONFDIR}</code>. To achieve this,
                   9318:             the variables <code class="varname">CONF_FILES</code>
                   9319:             and <code class="varname">CONF_FILES_PERMS</code> are
                   9320:             used. Check out <a href="#files-outside-prefix" title=
1.52      tv       9321:             "12.1.2.&nbsp;File manipulation">Section&nbsp;12.1.2,
1.35      jmmv     9322:             &#8220;File manipulation&#8221;</a> for information
                   9323:             about their syntax and their purpose. Here is an
                   9324:             example, taken from the <a xmlns=
                   9325:             "http://www.w3.org/TR/xhtml1/transitional" href=
                   9326:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/mail/mutt/README.html"
1.45      wiz      9327:             target="_top"><code xmlns="" class=
                   9328:             "filename">mail/mutt</code></a> package:</p>
1.35      jmmv     9329:             <pre class="programlisting">
1.51      rillig   9330:     EGDIR=        ${PREFIX}/share/doc/mutt/samples
                   9331:     CONF_FILES=   ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc
1.35      jmmv     9332: </pre>
                   9333: 
                   9334:             <p>Note that the <code class="varname">EGDIR</code>
                   9335:             variable is specific to that package and has no meaning
                   9336:             outside it.</p>
                   9337:           </div>
                   9338: 
1.52      tv       9339:           <div class="sect2" lang="en">
1.35      jmmv     9340:             <div class="titlepage">
                   9341:               <div>
                   9342:                 <div>
1.52      tv       9343:                   <h3 class="title"><a name=
                   9344:                   "conf-files-disable"></a>12.2.4.&nbsp;Disabling
1.35      jmmv     9345:                   handling of configuration files</h3>
                   9346:                 </div>
                   9347:               </div>
                   9348:             </div>
                   9349: 
                   9350:             <p>The automatic copying of config files can be toggled
                   9351:             by setting the environment variable <code class=
                   9352:             "varname">PKG_CONFIG</code> prior to package
                   9353:             installation.</p>
                   9354:           </div>
                   9355:         </div>
                   9356: 
1.52      tv       9357:         <div class="sect1" lang="en">
1.35      jmmv     9358:           <div class="titlepage">
                   9359:             <div>
                   9360:               <div>
                   9361:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       9362:                 "rcd-scripts"></a>12.3.&nbsp;System startup
                   9363:                 scripts</h2>
1.35      jmmv     9364:               </div>
                   9365:             </div>
                   9366:           </div>
                   9367: 
                   9368:           <p>System startup scripts are special files because they
                   9369:           must be installed in a place known by the underlying OS,
                   9370:           usually outside the installation prefix. Therefore, the
                   9371:           same rules described in <a href=
                   9372:           "#files-and-dirs-outside-prefix" title=
1.38      dillo    9373:           "12.1.&nbsp;Files and directories outside the installation prefix">
1.52      tv       9374:           Section&nbsp;12.1, &#8220;Files and directories outside
                   9375:           the installation prefix&#8221;</a> apply, and the same
1.35      jmmv     9376:           solutions can be used. However, pkginstall provides a
1.36      wiz      9377:           special mechanism to handle these files.</p>
1.35      jmmv     9378: 
                   9379:           <p>In order to provide system startup scripts, the
                   9380:           package has to:</p>
                   9381: 
                   9382:           <div class="orderedlist">
                   9383:             <ol type="1">
                   9384:               <li>
1.45      wiz      9385:                 <p>Store the script inside <code xmlns=
                   9386:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9387:                 "filename">${FILESDIR}</code>, with the
                   9388:                 <code class="literal">.sh</code> suffix appended.
                   9389:                 Considering the <a xmlns=
                   9390:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   9391:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/cups/README.html"
1.45      wiz      9392:                 target="_top"><code xmlns="" class=
                   9393:                 "filename">print/cups</code></a> package as an
                   9394:                 example, it has a <code xmlns=
                   9395:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9396:                 "filename">cupsd.sh</code> in its files
                   9397:                 directory.</p>
                   9398:               </li>
                   9399: 
                   9400:               <li>
                   9401:                 <p>Tell pkginstall to handle it, appending the name
                   9402:                 of the script, without its extension, to the
                   9403:                 <code class="varname">RCD_SCRIPTS</code> variable.
                   9404:                 Continuing the previous example:</p>
                   9405:                 <pre class="programlisting">
1.51      rillig   9406:     RCD_SCRIPTS+=   cupsd
1.35      jmmv     9407: </pre>
                   9408:               </li>
                   9409:             </ol>
                   9410:           </div>
                   9411: 
                   9412:           <p>Once this is done, pkginstall will do the following
                   9413:           steps for each script in an automated fashion:</p>
                   9414: 
                   9415:           <div class="orderedlist">
                   9416:             <ol type="1">
                   9417:               <li>
                   9418:                 <p>Process the file found in the files directory
                   9419:                 applying all the substitutions described in the
1.45      wiz      9420:                 <code xmlns=
                   9421:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   9422:                 "filename">FILES_SUBST</code> variable.</p>
1.35      jmmv     9423:               </li>
                   9424: 
                   9425:               <li>
                   9426:                 <p>Copy the script from the files directory to the
1.45      wiz      9427:                 examples hierarchy, <code xmlns=
                   9428:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9429:                 "filename">${PREFIX}/share/examples/rc.d/</code>.
1.36      wiz      9430:                 Note that this master file must be explicitly
1.45      wiz      9431:                 registered in the <code xmlns=
                   9432:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9433:                 "filename">PLIST</code>.</p>
                   9434:               </li>
                   9435: 
                   9436:               <li>
                   9437:                 <p>Add code to the installation scripts to copy the
                   9438:                 startup script from the examples hierarchy into the
                   9439:                 system-wide startup scripts directory.</p>
                   9440:               </li>
                   9441:             </ol>
                   9442:           </div>
                   9443: 
1.52      tv       9444:           <div class="sect2" lang="en">
1.35      jmmv     9445:             <div class="titlepage">
                   9446:               <div>
                   9447:                 <div>
1.52      tv       9448:                   <h3 class="title"><a name=
                   9449:                   "rcd-scripts-disable"></a>12.3.1.&nbsp;Disabling
1.35      jmmv     9450:                   handling of system startup scripts</h3>
                   9451:                 </div>
                   9452:               </div>
                   9453:             </div>
                   9454: 
                   9455:             <p>The automatic copying of config files can be toggled
                   9456:             by setting the environment variable <code class=
                   9457:             "varname">PKG_RCD_SCRIPTS</code> prior to package
                   9458:             installation. Note that the scripts will be always
1.45      wiz      9459:             copied inside the examples hierarchy, <code xmlns=
                   9460:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9461:             "filename">${PREFIX}/share/examples/rc.d/</code>, no
                   9462:             matter what the value of this variable is.</p>
                   9463:           </div>
                   9464:         </div>
                   9465: 
1.52      tv       9466:         <div class="sect1" lang="en">
1.35      jmmv     9467:           <div class="titlepage">
                   9468:             <div>
                   9469:               <div>
                   9470:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       9471:                 "users-and-groups"></a>12.4.&nbsp;System users and
                   9472:                 groups</h2>
1.35      jmmv     9473:               </div>
                   9474:             </div>
                   9475:           </div>
                   9476: 
                   9477:           <p>If a package needs to create special users and/or
                   9478:           groups during installation, it can do so by using the
                   9479:           pkginstall framework.</p>
                   9480: 
                   9481:           <p>Users can be created by adding entries to the
                   9482:           <code class="varname">PKG_USERS</code> variable. Each
1.45      wiz      9483:           entry has the following syntax, which mimics <code xmlns=
                   9484:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9485:           "filename">/etc/passwd</code>:</p>
                   9486:           <pre class="programlisting">
1.51      rillig   9487:     user:group[:[userid][:[descr][:[home][:shell]]]]
1.35      jmmv     9488: </pre>
                   9489: 
                   9490:           <p>Only the user and group are required; everything else
                   9491:           is optional, but the colons must be in the right places
                   9492:           when specifying optional bits. By default, a new user
1.45      wiz      9493:           will have home directory <code xmlns=
                   9494:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9495:           "filename">/nonexistent</code>, and login shell
1.45      wiz      9496:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   9497:           class="filename">/sbin/nologin</code> unless they are
                   9498:           specified as part of the user element. Note that if the
1.51      rillig   9499:           description contains spaces, then spaces should be
1.45      wiz      9500:           backslash-escaped, as in:</p>
1.35      jmmv     9501:           <pre class="programlisting">
1.51      rillig   9502:     foo:foogrp::The\ Foomister
1.35      jmmv     9503: </pre>
                   9504: 
                   9505:           <p>Similarly, groups can be created using the
                   9506:           <code class="varname">PKG_GROUPS</code> variable, whose
                   9507:           syntax is:</p>
                   9508:           <pre class="programlisting">
1.51      rillig   9509:     group[:groupid]
1.35      jmmv     9510: </pre>
                   9511: 
                   9512:           <p>As before, only the group name is required; the
                   9513:           numeric identifier is optional.</p>
                   9514:         </div>
                   9515: 
1.52      tv       9516:         <div class="sect1" lang="en">
1.35      jmmv     9517:           <div class="titlepage">
                   9518:             <div>
                   9519:               <div>
                   9520:                 <h2 class="title" style="clear: both"><a name=
1.52      tv       9521:                 "shells"></a>12.5.&nbsp;System shells</h2>
1.35      jmmv     9522:               </div>
                   9523:             </div>
                   9524:           </div>
                   9525: 
                   9526:           <p>Packages that install system shells should register
1.45      wiz      9527:           them in the shell database, <code xmlns=
                   9528:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9529:           "filename">/etc/shells</code>, to make things easier to
                   9530:           the administrator. This must be done from the
                   9531:           installation scripts to keep binary packages working on
                   9532:           any system. pkginstall provides an easy way to accomplish
                   9533:           this task.</p>
                   9534: 
                   9535:           <p>When a package provides a shell interpreter, it has to
                   9536:           set the <code class="varname">PKG_SHELL</code> variable
                   9537:           to its absolute file name. This will add some hooks to
                   9538:           the installation scripts to handle it. Consider the
                   9539:           following example, taken from <a xmlns=
                   9540:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   9541:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/shells/zsh/README.html"
1.45      wiz      9542:           target="_top"><code xmlns="" class=
                   9543:           "filename">shells/zsh</code></a>:</p>
1.35      jmmv     9544:           <pre class="programlisting">
1.51      rillig   9545:     USE_PKGINSTALL= YES
                   9546:     PKG_SHELL=      ${PREFIX}/bin/zsh
1.35      jmmv     9547: </pre>
                   9548: 
1.52      tv       9549:           <div class="sect2" lang="en">
1.35      jmmv     9550:             <div class="titlepage">
                   9551:               <div>
                   9552:                 <div>
1.52      tv       9553:                   <h3 class="title"><a name=
                   9554:                   "shells-disable"></a>12.5.1.&nbsp;Disabling
                   9555:                   handling of configuration files</h3>
1.35      jmmv     9556:                 </div>
                   9557:               </div>
                   9558:             </div>
                   9559: 
                   9560:             <p>The automatic registration of shell interpreters can
                   9561:             be disabled by the administrator by setting the
1.45      wiz      9562:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   9563:             class="filename">PKG_REGISTER_SHELLS</code> environment
                   9564:             variable to <code class="literal">NO</code>.</p>
1.35      jmmv     9565:           </div>
                   9566:         </div>
                   9567:       </div>
                   9568: 
1.52      tv       9569:       <div class="chapter" lang="en">
1.35      jmmv     9570:         <div class="titlepage">
                   9571:           <div>
                   9572:             <div>
1.52      tv       9573:               <h2 class="title"><a name=
1.38      dillo    9574:               "options"></a>Chapter&nbsp;13.&nbsp;Options
1.35      jmmv     9575:               handling</h2>
                   9576:             </div>
                   9577:           </div>
                   9578:         </div>
                   9579: 
                   9580:         <div class="toc">
                   9581:           <p><b>Table of Contents</b></p>
                   9582: 
                   9583:           <dl>
                   9584:             <dt><span class="sect1"><a href=
1.38      dillo    9585:             "#global-default-options">13.1. Global default
1.35      jmmv     9586:             options</a></span></dt>
                   9587: 
                   9588:             <dt><span class="sect1"><a href=
1.38      dillo    9589:             "#converting-to-options">13.2. Converting packages to
1.45      wiz      9590:             use <code xmlns=
                   9591:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9592:             "filename">bsd.options.mk</code></a></span></dt>
1.48      dillo    9593: 
                   9594:             <dt><span class="sect1"><a href="#option-names">13.3.
                   9595:             Option Names</a></span></dt>
1.35      jmmv     9596:           </dl>
                   9597:         </div>
                   9598: 
                   9599:         <p>Many packages have the ability to be built to support
1.45      wiz      9600:         different sets of features. <code xmlns=
                   9601:         "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9602:         "filename">bsd.options.mk</code> is a framework in pkgsrc
                   9603:         that provides generic handling of those options that
                   9604:         determine different ways in which the packages can be
                   9605:         built. It's possible for the user to specify exactly which
                   9606:         sets of options will be built into a package or to allow a
                   9607:         set of global default options apply.</p>
                   9608: 
1.52      tv       9609:         <div class="sect1" lang="en">
1.35      jmmv     9610:           <div class="titlepage">
                   9611:             <div>
                   9612:               <div>
                   9613:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    9614:                 "global-default-options"></a>13.1.&nbsp;Global
1.35      jmmv     9615:                 default options</h2>
                   9616:               </div>
                   9617:             </div>
                   9618:           </div>
                   9619: 
                   9620:           <p>Global default options are listed in <code class=
                   9621:           "varname">PKG_DEFAULT_OPTIONS</code>, which is a list of
                   9622:           the options that should be built into every package if
                   9623:           that option is supported. This variable should be set in
1.45      wiz      9624:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   9625:           class="filename">/etc/mk.conf</code>.</p>
1.35      jmmv     9626:         </div>
                   9627: 
1.52      tv       9628:         <div class="sect1" lang="en">
1.35      jmmv     9629:           <div class="titlepage">
                   9630:             <div>
                   9631:               <div>
                   9632:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    9633:                 "converting-to-options"></a>13.2.&nbsp;Converting
1.45      wiz      9634:                 packages to use <code xmlns=
                   9635:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9636:                 "filename">bsd.options.mk</code></h2>
                   9637:               </div>
                   9638:             </div>
                   9639:           </div>
                   9640: 
1.45      wiz      9641:           <p>The following example shows how <code xmlns=
                   9642:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9643:           "filename">bsd.options.mk</code> should be used by the
                   9644:           hypothetical ``wibble'' package, either in the package
1.45      wiz      9645:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   9646:           class="filename">Makefile</code>, or in a file, e.g.
                   9647:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   9648:           class="filename">options.mk</code>, that is included by
                   9649:           the main package <code xmlns=
                   9650:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.35      jmmv     9651:           "filename">Makefile</code>.</p>
                   9652:           <pre class="programlisting">
1.51      rillig   9653:     PKG_OPTIONS_VAR=            PKG_OPTIONS.wibble
                   9654:     PKG_SUPPORTED_OPTIONS=              wibble-foo ldap
                   9655:     PKG_OPTIONS_OPTIONAL_GROUPS=        database
                   9656:     PKG_OPTIONS_GROUP.database= mysql pgsql
                   9657:     PKG_SUGGESTED_OPTIONS=              wibble-foo
                   9658:     PKG_OPTIONS_LEGACY_VARS+=   WIBBLE_USE_OPENLDAP:ldap
                   9659:     PKG_OPTIONS_LEGACY_OPTS+=   foo:wibble-foo
                   9660: 
                   9661:     .include "../../mk/bsd.prefs.mk"
                   9662: 
                   9663:     # this package was previously named wibble2
                   9664:     .if defined(PKG_OPTIONS.wibble2)
                   9665:     PKG_LEGACY_OPTIONS+=  ${PKG_OPTIONS.wibble2}
                   9666:     PKG_OPTIONS_DEPRECATED_WARNINGS+= \
                   9667:             "Deprecated variable PKG_OPTIONS.wibble2 used, use "${PKG_OPTIONS_VAR:Q}" instead."
                   9668:     .endif
                   9669: 
                   9670:     .include "../../mk/bsd.options.mk"
                   9671: 
                   9672:     # Package-specific option-handling
                   9673: 
                   9674:     ###
                   9675:     ### FOO support
                   9676:     ###
                   9677:     .if !empty(PKG_OPTIONS:Mwibble-foo)
                   9678:     CONFIGURE_ARGS+=    --enable-foo
                   9679:     .endif
                   9680: 
                   9681:     ###
                   9682:     ### LDAP support
                   9683:     ###
                   9684:     .if !empty(PKG_OPTIONS:Mldap)
                   9685:     .  include "../../databases/openldap/buildlink3.mk"
                   9686:     CONFIGURE_ARGS+=    --enable-ldap=${BUILDLINK_PREFIX.openldap}
                   9687:     .endif
                   9688: 
                   9689:     ###
                   9690:     ### database support
                   9691:     ###
                   9692:     .if !empty(PKG_OPTIONS:Mmysql)
                   9693:     .  include "../../mk/mysql.buildlink3.mk"
                   9694:     .endif
                   9695:     .if !empty(PKG_OPTIONS:Mpgsql)
                   9696:     .  include "../../mk/pgsql.buildlink3.mk"
                   9697:     .endif
1.1       grant    9698: </pre>
                   9699: 
1.28      rillig   9700:           <p>The first section contains the information about which
                   9701:           build options are supported by the package, and any
1.1       grant    9702:           default options settings if needed.</p>
                   9703: 
                   9704:           <div class="orderedlist">
                   9705:             <ol type="1">
                   9706:               <li>
1.14      xtraeme  9707:                 <p><code class="varname">PKG_OPTIONS_VAR</code> is
1.27      rillig   9708:                 the name of the <a href=
1.1       grant    9709:                 "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current">
                   9710:                 <span class="citerefentry"><span class=
1.27      rillig   9711:                 "refentrytitle">make</span>(1)</span></a> variable
1.37      dillo    9712:                 that the user can set to override the default
                   9713:                 options. It should be set to &#8220;<span class=
                   9714:                 "quote">PKG_OPTIONS.<em class=
1.38      dillo    9715:                 "replaceable"><code>pkgbase</code></em></span>&#8221;.</p>
1.1       grant    9716:               </li>
                   9717: 
                   9718:               <li>
1.14      xtraeme  9719:                 <p><code class=
                   9720:                 "varname">PKG_SUPPORTED_OPTIONS</code> is a list of
1.37      dillo    9721:                 build options supported by the package.</p>
                   9722:               </li>
                   9723: 
                   9724:               <li>
                   9725:                 <p><code class=
                   9726:                 "varname">PKG_OPTIONS_OPTIONAL_GROUPS</code> is a
                   9727:                 list of names of groups of mutually exclusive
                   9728:                 options. The options in each group are listed in
                   9729:                 <code class="varname">PKG_OPTIONS_GROUP.<em class=
                   9730:                 "replaceable"><code>groupname</code></em></code>.
                   9731:                 The most specific setting of any option from the
                   9732:                 group takes precedence over all other options in
                   9733:                 the group. Options from the groups will be
                   9734:                 automatically added to <code class=
                   9735:                 "varname">PKG_SUPPORTED_OPTIONS</code>.</p>
                   9736:               </li>
                   9737: 
                   9738:               <li>
                   9739:                 <p><code class=
                   9740:                 "varname">PKG_OPTIONS_REQUIRED_GROUPS</code> is
                   9741:                 like <code class=
                   9742:                 "varname">PKG_OPTIONS_OPTIONAL_GROUPS</code>, but
                   9743:                 building the packages will fail if no option from
                   9744:                 the group is selected.</p>
1.1       grant    9745:               </li>
                   9746: 
                   9747:               <li>
1.27      rillig   9748:                 <p><code class=
1.44      gdt      9749:                 "varname">PKG_OPTIONS_NONEMPTY_SETS</code> is a
                   9750:                 list of names of sets of options. At least one
                   9751:                 option from each set must be selected. The options
                   9752:                 in each set are listed in <code class=
                   9753:                 "varname">PKG_OPTIONS_SET.<em class=
                   9754:                 "replaceable"><code>setname</code></em></code>.
                   9755:                 Options from the sets will be automatically added
                   9756:                 to <code class=
                   9757:                 "varname">PKG_SUPPORTED_OPTIONS</code>. Building
                   9758:                 the package will fail if no option from the set is
                   9759:                 selected.</p>
                   9760:               </li>
                   9761: 
                   9762:               <li>
                   9763:                 <p><code class=
1.27      rillig   9764:                 "varname">PKG_SUGGESTED_OPTIONS</code> is a list of
                   9765:                 build options which are enabled by default.</p>
                   9766:               </li>
                   9767: 
                   9768:               <li>
1.37      dillo    9769:                 <p><code class=
                   9770:                 "varname">PKG_OPTIONS_LEGACY_VARS</code> is a list
                   9771:                 of &#8220;<span class="quote"><em class=
1.52      tv       9772:                 "replaceable"><code>USE_VARIABLE</code></em>:<em class="replaceable"><code>option</code></em></span>&#8221;
                   9773:                 pairs that map legacy <code xmlns=
1.45      wiz      9774:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.37      dillo    9775:                 "filename">/etc/mk.conf</code> variables to their
                   9776:                 option counterparts. Pairs should be added with
                   9777:                 &#8220;<span class="quote">+=</span>&#8221; to keep
                   9778:                 the listing of global legacy variables. A warning
                   9779:                 will be issued if the user uses a legacy
                   9780:                 variable.</p>
                   9781:               </li>
1.1       grant    9782: 
1.37      dillo    9783:               <li>
                   9784:                 <p><code class=
                   9785:                 "varname">PKG_OPTIONS_LEGACY_OPTS</code> is a list
                   9786:                 of &#8220;<span class="quote"><em class=
1.52      tv       9787:                 "replaceable"><code>old-option</code></em>:<em class="replaceable"><code>new-option</code></em></span>&#8221;
                   9788:                 pairs that map options that have been renamed to
                   9789:                 their new counterparts. Pairs should be added with
1.37      dillo    9790:                 &#8220;<span class="quote">+=</span>&#8221; to keep
                   9791:                 the listing of global legacy options. A warning
                   9792:                 will be issued if the user uses a legacy
                   9793:                 option.</p>
                   9794:               </li>
1.1       grant    9795: 
1.37      dillo    9796:               <li>
                   9797:                 <p><code class="varname">PKG_LEGACY_OPTIONS</code>
                   9798:                 is a list of options implied by deprecated
                   9799:                 variables used. This can be used for cases that
                   9800:                 neither <code class=
                   9801:                 "varname">PKG_OPTIONS_LEGACY_VARS</code> nor
                   9802:                 <code class=
                   9803:                 "varname">PKG_OPTIONS_LEGACY_OPTS</code> can
                   9804:                 handle, e. g. when <code class=
                   9805:                 "varname">PKG_OPTIONS_VAR</code> is renamed.</p>
1.1       grant    9806:               </li>
                   9807: 
                   9808:               <li>
1.37      dillo    9809:                 <p><code class=
                   9810:                 "varname">PKG_OPTIONS_DEPRECATED_WARNINGS</code> is
                   9811:                 a list of warnings about deprecated variables or
                   9812:                 options used, and what to use instead.</p>
1.1       grant    9813:               </li>
1.28      rillig   9814:             </ol>
1.1       grant    9815:           </div>
                   9816: 
1.37      dillo    9817:           <p>A package should never modify <code class=
                   9818:           "varname">PKG_DEFAULT_OPTIONS</code> or the variable
                   9819:           named in <code class="varname">PKG_OPTIONS_VAR</code>.
                   9820:           These are strictly user-settable. To suggest a default
                   9821:           set of options, use <code class=
                   9822:           "varname">PKG_SUGGESTED_OPTIONS</code>.</p>
                   9823: 
1.42      dillo    9824:           <p><code class="varname">PKG_OPTIONS_VAR</code> must be
1.45      wiz      9825:           defined before including <code xmlns=
                   9826:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.42      dillo    9827:           "filename">bsd.options.mk</code>. If none of <code class=
1.37      dillo    9828:           "varname">PKG_SUPPORTED_OPTIONS</code>, <code class=
                   9829:           "varname">PKG_OPTIONS_OPTIONAL_GROUPS</code>, and
                   9830:           <code class="varname">PKG_OPTIONS_REQUIRED_GROUPS</code>
1.47      reed     9831:           are defined (as can happen with platform-specific options
1.42      dillo    9832:           if none of them is supported on the current platform),
                   9833:           <code class="varname">PKG_OPTIONS</code> is set to the
                   9834:           empty list and the package is otherwise treated as not
                   9835:           using the options framework.</p>
1.37      dillo    9836: 
1.45      wiz      9837:           <p>After the inclusion of <code xmlns=
                   9838:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.37      dillo    9839:           "filename">bsd.options.mk</code>, the variable
1.28      rillig   9840:           <code class="varname">PKG_OPTIONS</code> contains the
1.37      dillo    9841:           list of selected build options, properly filtered to
1.28      rillig   9842:           remove unsupported and duplicate options.</p>
                   9843: 
1.1       grant    9844:           <p>The remaining sections contain the logic that is
1.37      dillo    9845:           specific to each option. The correct way to check for an
                   9846:           option is to check whether it is listed in <code class=
                   9847:           "varname">PKG_OPTIONS</code>:</p>
                   9848:           <pre class="programlisting">
1.51      rillig   9849:     .if !empty(PKG_OPTIONS:M<em class=
1.37      dillo    9850: "replaceable"><code>option</code></em>)
                   9851: </pre>
1.48      dillo    9852:         </div>
1.37      dillo    9853: 
1.52      tv       9854:         <div class="sect1" lang="en">
1.48      dillo    9855:           <div class="titlepage">
                   9856:             <div>
                   9857:               <div>
                   9858:                 <h2 class="title" style="clear: both"><a name=
                   9859:                 "option-names"></a>13.3.&nbsp;Option Names</h2>
                   9860:               </div>
                   9861:             </div>
                   9862:           </div>
                   9863: 
                   9864:           <p>Options that enable similar features in different
                   9865:           packages (like optional support for a library) should use
                   9866:           a common name in all packages that support it (like the
                   9867:           name of the library). If another package already has an
                   9868:           option with the same meaning, use the same name.</p>
                   9869: 
                   9870:           <p>Options that enable features specific to one package,
                   9871:           where it's unlikely that another (unrelated) package has
                   9872:           the same (or a similar) optional feature, should use a
                   9873:           name prefixed with <code class="varname"><em class=
                   9874:           "replaceable"><code>pkgname</code></em>-</code>.</p>
                   9875: 
                   9876:           <p>If a group of related packages share an optional
                   9877:           feature specific to that group, prefix it with the name
                   9878:           of the &#8220;<span class="quote">main</span>&#8221;
                   9879:           package (e. g. <code class=
                   9880:           "varname">djbware-errno-hack</code>).</p>
                   9881: 
                   9882:           <p>For new options, add a line to <code xmlns=
                   9883:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   9884:           "filename">mk/defaults/options.description</code>. Lines
                   9885:           have two fields, separated by tab. The first field is the
                   9886:           option name, the second its description. The description
                   9887:           should be a whole sentence (starting with an uppercase
                   9888:           letter and ending with a period) that describes what
                   9889:           enabling the option does. E. g. &#8220;<span class=
                   9890:           "quote">Enable ispell support.</span>&#8221; The file is
                   9891:           sorted by option names.</p>
1.1       grant    9892:         </div>
                   9893:       </div>
                   9894: 
1.52      tv       9895:       <div class="chapter" lang="en">
1.1       grant    9896:         <div class="titlepage">
                   9897:           <div>
                   9898:             <div>
1.52      tv       9899:               <h2 class="title"><a name=
1.38      dillo    9900:               "build"></a>Chapter&nbsp;14.&nbsp;The build
1.1       grant    9901:               process</h2>
                   9902:             </div>
                   9903:           </div>
                   9904:         </div>
                   9905: 
                   9906:         <div class="toc">
                   9907:           <p><b>Table of Contents</b></p>
                   9908: 
                   9909:           <dl>
1.38      dillo    9910:             <dt><span class="sect1"><a href="#build.prefix">14.1.
1.1       grant    9911:             Program location</a></span></dt>
                   9912: 
1.38      dillo    9913:             <dt><span class="sect1"><a href="#main-targets">14.2.
1.30      wiz      9914:             Main targets</a></span></dt>
1.1       grant    9915: 
                   9916:             <dt><span class="sect1"><a href=
1.38      dillo    9917:             "#build.helpful-targets">14.3. Other helpful
1.1       grant    9918:             targets</a></span></dt>
                   9919:           </dl>
                   9920:         </div>
                   9921: 
                   9922:         <p>The basic steps for building a program are always the
                   9923:         same. First the program's source (<span class=
                   9924:         "emphasis"><em>distfile</em></span>) must be brought to the
                   9925:         local system and then extracted. After any patches to
                   9926:         compile properly on NetBSD are applied, the software can be
                   9927:         configured, then built (usually by compiling), and finally
                   9928:         the generated binaries, etc. can be put into place on the
                   9929:         system. These are exactly the steps performed by the NetBSD
                   9930:         package system, which is implemented as a series of targets
1.45      wiz      9931:         in a central Makefile, <code xmlns=
                   9932:         "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  9933:         "filename">pkgsrc/mk/bsd.pkg.mk</code>.</p>
1.1       grant    9934: 
1.52      tv       9935:         <div class="sect1" lang="en">
1.1       grant    9936:           <div class="titlepage">
                   9937:             <div>
                   9938:               <div>
                   9939:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    9940:                 "build.prefix"></a>14.1.&nbsp;Program location</h2>
1.1       grant    9941:               </div>
                   9942:             </div>
                   9943:           </div>
                   9944: 
                   9945:           <p>Before outlining the process performed by the NetBSD
                   9946:           package system in the next section, here's a brief
                   9947:           discussion on where programs are installed, and which
                   9948:           variables influence this.</p>
                   9949: 
1.14      xtraeme  9950:           <p>The automatic variable <code class=
                   9951:           "varname">PREFIX</code> indicates where all files of the
                   9952:           final program shall be installed. It is usually set to
1.45      wiz      9953:           <code class="varname">LOCALBASE</code> (<code xmlns=
                   9954:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  9955:           "filename">/usr/pkg</code>), or <code class=
                   9956:           "varname">CROSSBASE</code> for pkgs in the
1.1       grant    9957:           &#8220;<span class="quote">cross</span>&#8221; category.
1.14      xtraeme  9958:           The value of <code class="varname">PREFIX</code> needs to
                   9959:           be put into the various places in the program's source
                   9960:           where paths to these files are encoded. See <a href=
1.1       grant    9961:           "#components.patches" title=
1.38      dillo    9962:           "8.3.&nbsp;patches/*">Section&nbsp;8.3,
1.1       grant    9963:           &#8220;patches/*&#8221;</a> and <a href="#fixes.libtool"
                   9964:           title=
1.38      dillo    9965:           "15.3.1.&nbsp;Shared libraries - libtool">Section&nbsp;15.3.1,
1.1       grant    9966:           &#8220;Shared libraries - libtool&#8221;</a> for more
                   9967:           details.</p>
                   9968: 
                   9969:           <p>When choosing which of these variables to use, follow
                   9970:           the following rules:</p>
                   9971: 
                   9972:           <div class="itemizedlist">
                   9973:             <ul type="disc">
                   9974:               <li>
1.14      xtraeme  9975:                 <p><code class="varname">PREFIX</code> always
                   9976:                 points to the location where the current pkg will
                   9977:                 be installed. When referring to a pkg's own
1.1       grant    9978:                 installation path, use &#8220;<span class=
                   9979:                 "quote">${PREFIX}</span>&#8221;.</p>
                   9980:               </li>
                   9981: 
                   9982:               <li>
1.14      xtraeme  9983:                 <p><code class="varname">LOCALBASE</code> is where
                   9984:                 all non-X11 pkgs are installed. If you need to
1.1       grant    9985:                 construct a -I or -L argument to the compiler to
                   9986:                 find includes and libraries installed by another
                   9987:                 non-X11 pkg, use &#8220;<span class=
                   9988:                 "quote">${LOCALBASE}</span>&#8221;.</p>
                   9989:               </li>
                   9990: 
                   9991:               <li>
1.14      xtraeme  9992:                 <p><code class="varname">X11BASE</code> is where
                   9993:                 the actual X11 distribution (from xsrc, etc.) is
1.1       grant    9994:                 installed. When looking for <span class=
                   9995:                 "emphasis"><em>standard</em></span> X11 includes
                   9996:                 (not those installed by a pkg), use
                   9997:                 &#8220;<span class=
                   9998:                 "quote">${X11BASE}</span>&#8221;.</p>
                   9999:               </li>
                   10000: 
                   10001:               <li>
1.47      reed     10002:                 <p>X11-based packages are special in that they may
                   10003:                 be installed in either <code class=
1.14      xtraeme  10004:                 "varname">X11BASE</code> or <code class=
                   10005:                 "varname">LOCALBASE</code>.</p>
1.1       grant    10006: 
                   10007:                 <p>Usually, X11 packages should be installed under
1.14      xtraeme  10008:                 <code class="varname">LOCALBASE</code> whenever
1.34      wiz      10009:                 possible. Note that you will need to include
1.45      wiz      10010:                 <code xmlns=
                   10011:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.34      wiz      10012:                 "filename">../../mk/x11.buildlink3.mk</code> in
                   10013:                 them to request the presence of X11 and to get the
                   10014:                 right compilation flags.</p>
1.1       grant    10015: 
                   10016:                 <p>Even though, there are some packages that cannot
1.14      xtraeme  10017:                 be installed under <code class=
                   10018:                 "varname">LOCALBASE</code>: those that come with
1.1       grant    10019:                 app-defaults files. These packages are special and
1.14      xtraeme  10020:                 they must be placed under <code class=
                   10021:                 "varname">X11BASE</code>. To accomplish this, set
                   10022:                 either <code class="varname">USE_X11BASE</code> or
                   10023:                 <code class="varname">USE_IMAKE</code> in your
1.1       grant    10024:                 package.</p>
                   10025: 
1.34      wiz      10026:                 <p>Some notes: If you need to find includes or
1.14      xtraeme  10027:                 libraries installed by a pkg that has <code class=
                   10028:                 "varname">USE_IMAKE</code> or <code class=
                   10029:                 "varname">USE_X11BASE</code> in its pkg
1.45      wiz      10030:                 <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   10031:                 class="filename">Makefile</code>, you need to look
                   10032:                 in <span class="emphasis"><em>both</em></span>
                   10033:                 <code xmlns=
                   10034:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10035:                 "filename">${X11BASE}</code> and <code xmlns=
                   10036:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10037:                 "filename">${LOCALBASE}</code>. To force
                   10038:                 installation of all X11 packages in <code class=
                   10039:                 "varname">LOCALBASE</code>, the <a xmlns=
                   10040:                 "http://www.w3.org/TR/xhtml1/transitional" href=
1.1       grant    10041:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/xpkgwedge/README.html"
1.45      wiz      10042:                 target="_top"><code xmlns="" class=
                   10043:                 "filename">pkgtools/xpkgwedge</code></a> package is
1.34      wiz      10044:                 enabled by default.</p>
1.1       grant    10045:               </li>
                   10046: 
                   10047:               <li>
1.14      xtraeme  10048:                 <p><code class="varname">X11PREFIX</code> should be
1.1       grant    10049:                 used to refer to the installed location of an X11
1.14      xtraeme  10050:                 package. <code class="varname">X11PREFIX</code>
                   10051:                 will be set to <code class="varname">X11BASE</code>
                   10052:                 if xpkgwedge is not installed, and to <code class=
                   10053:                 "varname">LOCALBASE</code> if xpkgwedge is
1.1       grant    10054:                 installed.</p>
                   10055:               </li>
                   10056: 
                   10057:               <li>
                   10058:                 <p>If xpkgwedge is installed, it is possible to
1.14      xtraeme  10059:                 have some packages installed in <code class=
                   10060:                 "varname">X11BASE</code> and some in <code class=
                   10061:                 "varname">LOCALBASE</code>. To determine the prefix
                   10062:                 of an installed package, the <code class=
                   10063:                 "varname">EVAL_PREFIX</code> definition can be
                   10064:                 used. It takes pairs in the format
                   10065:                 &#8220;<span class=
1.1       grant    10066:                 "quote">DIRNAME=&lt;package&gt;</span>&#8221;, and
1.24      wiz      10067:                 the <a href=
                   10068:                 "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current">
                   10069:                 <span class="citerefentry"><span class=
                   10070:                 "refentrytitle">make</span>(1)</span></a> variable
                   10071:                 <code class="varname">DIRNAME</code> will be set to
                   10072:                 the prefix of the installed package
                   10073:                 &lt;package&gt;, or &#8220;<span class=
1.1       grant    10074:                 "quote">${X11PREFIX}</span>&#8221; if the package
                   10075:                 is not installed.</p>
                   10076: 
                   10077:                 <p>This is best illustrated by example.</p>
                   10078: 
1.45      wiz      10079:                 <p>The following lines are taken from <code xmlns=
                   10080:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10081:                 "filename">pkgsrc/wm/scwm/Makefile</code>:</p>
1.1       grant    10082:                 <pre class="programlisting">
1.51      rillig   10083:     EVAL_PREFIX+=           GTKDIR=gtk+
                   10084:     CONFIGURE_ARGS+=        --with-guile-prefix=${LOCALBASE}        \
                   10085:                             --with-gtk-prefix="${GTKDIR}"           \
                   10086:                             --enable-multibyte
1.1       grant    10087: </pre>
                   10088: 
                   10089:                 <p>Specific defaults can be defined for the
1.14      xtraeme  10090:                 packages evaluated using <code class=
                   10091:                 "varname">EVAL_PREFIX</code>, by using a definition
1.1       grant    10092:                 of the form:</p>
                   10093:                 <pre class="programlisting">
1.51      rillig   10094:     GTKDIR_DEFAULT= ${LOCALBASE}
1.1       grant    10095: </pre>
                   10096: 
1.14      xtraeme  10097:                 <p>where <code class="varname">GTKDIR</code>
1.1       grant    10098:                 corresponds to the first definition in the
1.14      xtraeme  10099:                 <code class="varname">EVAL_PREFIX</code> pair.</p>
1.1       grant    10100:               </li>
                   10101: 
                   10102:               <li>
1.45      wiz      10103:                 <p>Within <code xmlns=
                   10104:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10105:                 "filename">${PREFIX}</code>, packages should
                   10106:                 install files according to <a href=
1.24      wiz      10107:                 "http://netbsd.gw.com/cgi-bin/man-cgi?hier+7+NetBSD-current">
                   10108:                 <span class="citerefentry"><span class=
                   10109:                 "refentrytitle">hier</span>(7)</span></a>, with the
1.45      wiz      10110:                 exception that manual pages go into <code xmlns=
                   10111:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10112:                 "filename">${PREFIX}/man</code>, not <code xmlns=
                   10113:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10114:                 "filename">${PREFIX}/share/man</code>.</p>
1.1       grant    10115:               </li>
                   10116:             </ul>
                   10117:           </div>
                   10118:         </div>
                   10119: 
1.52      tv       10120:         <div class="sect1" lang="en">
1.1       grant    10121:           <div class="titlepage">
                   10122:             <div>
                   10123:               <div>
                   10124:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    10125:                 "main-targets"></a>14.2.&nbsp;Main targets</h2>
1.1       grant    10126:               </div>
                   10127:             </div>
                   10128:           </div>
                   10129: 
                   10130:           <p>The main targets used during the build process defined
1.45      wiz      10131:           in <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   10132:           class="filename">bsd.pkg.mk</code> are:</p>
1.1       grant    10133: 
                   10134:           <div class="variablelist">
                   10135:             <dl>
                   10136:               <dt><span class="term">fetch</span></dt>
                   10137: 
                   10138:               <dd>
                   10139:                 <p>This will check if the file(s) given in the
1.14      xtraeme  10140:                 variables <code class="varname">DISTFILES</code>
                   10141:                 and <code class="varname">PATCHFILES</code> (as
                   10142:                 defined in the package's Makefile) are present on
1.45      wiz      10143:                 the local system in <code xmlns=
                   10144:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10145:                 "filename">/usr/pkgsrc/distfiles</code>. If they
                   10146:                 are not present, an attempt will be made to fetch
                   10147:                 them using commands of the form:</p>
1.1       grant    10148:                 <pre class="programlisting">
1.51      rillig   10149:     ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS}
1.1       grant    10150: </pre>
                   10151: 
                   10152:                 <p>where ${site} varies through several
1.14      xtraeme  10153:                 possibilities in turn: first, <code class=
                   10154:                 "varname">MASTER_SITE_OVERRIDE</code> is tried,
                   10155:                 then the sites specified in either <code class=
                   10156:                 "varname">SITES_file</code> if defined, else
                   10157:                 <code class="varname">MASTER_SITES</code> or
                   10158:                 <code class="varname">PATCH_SITES</code>, as
                   10159:                 applies, then finally the value of <code class=
                   10160:                 "varname">MASTER_SITE_BACKUP</code>. The order of
                   10161:                 all except the first can be optionally sorted by
                   10162:                 the user, via setting either <code class=
                   10163:                 "varname">MASTER_SORT_AWK</code> or <code class=
                   10164:                 "varname">MASTER_SORT_REGEX</code>.</p>
1.1       grant    10165:               </dd>
                   10166: 
                   10167:               <dt><span class="term">checksum</span></dt>
                   10168: 
                   10169:               <dd>
                   10170:                 <p>After the distfile(s) are fetched, their
                   10171:                 checksum is generated and compared with the
                   10172:                 checksums stored in the distinfo file. If the
                   10173:                 checksums don't match, the build is aborted. This
                   10174:                 is to ensure the same distfile is used for
                   10175:                 building, and that the distfile wasn't changed,
                   10176:                 e.g. by some malign force, deliberately changed
                   10177:                 distfiles on the master distribution site or
                   10178:                 network lossage.</p>
                   10179:               </dd>
                   10180: 
                   10181:               <dt><span class="term">extract</span></dt>
                   10182: 
                   10183:               <dd>
                   10184:                 <p>When the distfiles are present on the local
                   10185:                 system, they need to be extracted, as they are
                   10186:                 usually in the form of some compressed archive
1.45      wiz      10187:                 format, most commonly <code xmlns=
                   10188:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10189:                 "filename">.tar.gz</code>.</p>
1.1       grant    10190: 
                   10191:                 <p>If only some of the distfiles need to be
                   10192:                 uncompressed, the files to be uncompressed should
1.14      xtraeme  10193:                 be put into <code class=
                   10194:                 "varname">EXTRACT_ONLY</code>.</p>
1.1       grant    10195: 
1.45      wiz      10196:                 <p>If the distfiles are not in <code xmlns=
                   10197:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10198:                 "filename">.tar.gz</code> format, they can be
                   10199:                 extracted by setting either <code class=
                   10200:                 "varname">EXTRACT_SUFX</code>, or <code class=
                   10201:                 "varname">EXTRACT_CMD</code>, <code class=
                   10202:                 "varname">EXTRACT_BEFORE_ARGS</code> and
                   10203:                 <code class="varname">EXTRACT_AFTER_ARGS</code>. In
                   10204:                 the former case, pkgsrc knows how to extract a
1.45      wiz      10205:                 number of suffixes (<code xmlns=
                   10206:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10207:                 "filename">.tar.gz</code>, <code xmlns=
                   10208:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10209:                 "filename">.tgz</code>, <code xmlns=
                   10210:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10211:                 "filename">.tar.gz2</code>, <code xmlns=
                   10212:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10213:                 "filename">.tbz</code>, <code xmlns=
                   10214:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10215:                 "filename">.tar.Z</code>, <code xmlns=
                   10216:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10217:                 "filename">.tar</code>, <code xmlns=
                   10218:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10219:                 "filename">.shar.gz</code>, <code xmlns=
                   10220:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10221:                 "filename">.shar.bz2</code>, <code xmlns=
                   10222:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10223:                 "filename">.shar.Z</code>, <code xmlns=
                   10224:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10225:                 "filename">.shar</code>, <code xmlns=
                   10226:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10227:                 "filename">.Z</code>, <code xmlns=
                   10228:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10229:                 "filename">.bz2</code> and <code xmlns=
                   10230:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10231:                 "filename">.gz</code>; see the definition of the
                   10232:                 various <code class="varname">DECOMPRESS_CMD</code>
1.47      reed     10233:                 variables in <code xmlns=
1.45      wiz      10234:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.47      reed     10235:                 "filename">bsd.pkg.extract.mk</code> for a complete
                   10236:                 list). Here's an example on how to use the other
                   10237:                 variables for a program that comes with a
                   10238:                 compressed shell archive whose name ends in
                   10239:                 <code xmlns=
1.45      wiz      10240:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10241:                 "filename">.msg.gz</code>:</p>
1.1       grant    10242:                 <pre class="programlisting">
1.51      rillig   10243:     EXTRACT_SUFX=           .msg.gz
                   10244:     EXTRACT_CMD=            zcat
                   10245:     EXTRACT_BEFORE_ARGS=
                   10246:     EXTRACT_AFTER_ARGS=     |sh
1.1       grant    10247: </pre>
                   10248:               </dd>
                   10249: 
                   10250:               <dt><span class="term">patch</span></dt>
                   10251: 
                   10252:               <dd>
                   10253:                 <p>After extraction, all the patches named by the
1.14      xtraeme  10254:                 <code class="varname">PATCHFILES</code>, those
                   10255:                 present in the patches subdirectory of the package
                   10256:                 as well as in $LOCALPATCHES/$PKGPATH (e.g.
1.45      wiz      10257:                 <code xmlns=
                   10258:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10259:                 "filename">/usr/local/patches/graphics/png</code>)
1.45      wiz      10260:                 are applied. Patchfiles ending in <code xmlns=
                   10261:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10262:                 "filename">.Z</code> or <code xmlns=
                   10263:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10264:                 "filename">.gz</code> are uncompressed before they
1.45      wiz      10265:                 are applied, files ending in <code xmlns=
                   10266:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10267:                 "filename">.orig</code> or <code xmlns=
                   10268:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10269:                 "filename">.rej</code> are ignored. Any special
1.24      wiz      10270:                 options to <a href=
                   10271:                 "http://netbsd.gw.com/cgi-bin/man-cgi?patch+1+NetBSD-current">
                   10272:                 <span class="citerefentry"><span class=
                   10273:                 "refentrytitle">patch</span>(1)</span></a> can be
                   10274:                 handed in <code class=
1.14      xtraeme  10275:                 "varname">PATCH_DIST_ARGS</code>. See <a href=
                   10276:                 "#components.patches" title=
1.38      dillo    10277:                 "8.3.&nbsp;patches/*">Section&nbsp;8.3,
1.1       grant    10278:                 &#8220;patches/*&#8221;</a> for more details.</p>
                   10279: 
1.24      wiz      10280:                 <p>By default <a href=
                   10281:                 "http://netbsd.gw.com/cgi-bin/man-cgi?patch+1+NetBSD-current">
                   10282:                 <span class="citerefentry"><span class=
                   10283:                 "refentrytitle">patch</span>(1)</span></a> is given
                   10284:                 special args to make it fail if the patches apply
                   10285:                 with some lines of fuzz. Please fix (regen) the
                   10286:                 patches so that they apply cleanly. The rationale
                   10287:                 behind this is that patches that don't apply
                   10288:                 cleanly may end up being applied in the wrong
                   10289:                 place, and cause severe harm there.</p>
1.1       grant    10290:               </dd>
                   10291: 
                   10292:               <dt><span class="term">configure</span></dt>
                   10293: 
                   10294:               <dd>
                   10295:                 <p>Most pieces of software need information on the
                   10296:                 header files, system calls, and library routines
                   10297:                 which are available in NetBSD. This is the process
                   10298:                 known as configuration, and is usually automated.
                   10299:                 In most cases, a script is supplied with the
                   10300:                 source, and its invocation results in generation of
                   10301:                 header files, Makefiles, etc.</p>
                   10302: 
                   10303:                 <p>If the program's distfile contains its own
                   10304:                 configure script, this can be invoked by setting
1.14      xtraeme  10305:                 <code class="varname">HAS_CONFIGURE</code>. If the
1.1       grant    10306:                 configure script is a GNU autoconf script,
1.14      xtraeme  10307:                 <code class="varname">GNU_CONFIGURE</code> should
                   10308:                 be specified instead. In either case, any arguments
                   10309:                 to the configure script can be specified in the
                   10310:                 <code class="varname">CONFIGURE_ARGS</code>
                   10311:                 variable, and the configure script's name can be
                   10312:                 set in <code class=
                   10313:                 "varname">CONFIGURE_SCRIPT</code> if it differs
                   10314:                 from the default &#8220;<span class=
1.1       grant    10315:                 "quote">configure</span>&#8221;. Here's an example
                   10316:                 from the <a xmlns=
                   10317:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   10318:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/sysutils/top/README.html"
1.45      wiz      10319:                 target="_top"><code xmlns="" class=
                   10320:                 "filename">sysutils/top</code></a> package:</p>
1.1       grant    10321:                 <pre class="programlisting">
1.51      rillig   10322:     HAS_CONFIGURE=          yes
                   10323:     CONFIGURE_SCRIPT=       Configure
                   10324:     CONFIGURE_ARGS+=        netbsd13
1.1       grant    10325: </pre>
                   10326: 
                   10327:                 <p>If the program uses an Imakefile for
                   10328:                 configuration, the appropriate steps can be invoked
1.14      xtraeme  10329:                 by setting <code class="varname">USE_IMAKE</code>
                   10330:                 to &#8220;<span class="quote">YES</span>&#8221;.
                   10331:                 (If you only want the package installed in
                   10332:                 <code class="varname">$X11PREFIX</code> but xmkmf
                   10333:                 not being run, set <code class=
                   10334:                 "varname">USE_X11BASE</code> instead!)</p>
1.1       grant    10335:               </dd>
                   10336: 
                   10337:               <dt><span class="term">build</span></dt>
                   10338: 
                   10339:               <dd>
                   10340:                 <p>Once configuration has taken place, the software
1.14      xtraeme  10341:                 will be built by invoking <code class=
                   10342:                 "varname">$MAKE_PROGRAM</code> on <code class=
                   10343:                 "varname">$MAKEFILE</code> with <code class=
                   10344:                 "varname">$BUILD_TARGET</code> as the target to
                   10345:                 build. The default <code class=
                   10346:                 "varname">MAKE_PROGRAM</code> is
                   10347:                 &#8220;<span class="quote">gmake</span>&#8221; if
1.29      rillig   10348:                 <code class="varname">USE_TOOLS</code> contains
                   10349:                 &#8220;<span class="quote">gmake</span>&#8221;,
1.1       grant    10350:                 &#8220;<span class="quote">make</span>&#8221;
1.14      xtraeme  10351:                 otherwise. <code class="varname">MAKEFILE</code> is
                   10352:                 set to &#8220;<span class=
1.1       grant    10353:                 "quote">Makefile</span>&#8221; by default, and
1.14      xtraeme  10354:                 <code class="varname">BUILD_TARGET</code> defaults
                   10355:                 to &#8220;<span class="quote">all</span>&#8221;.
                   10356:                 Any of these variables can be set in the package's
1.1       grant    10357:                 Makefile to change the default build process.</p>
                   10358:               </dd>
                   10359: 
                   10360:               <dt><span class="term">install</span></dt>
                   10361: 
                   10362:               <dd>
                   10363:                 <p>Once the build stage has completed, the final
                   10364:                 step is to install the software in public
                   10365:                 directories, so users can access the programs and
1.14      xtraeme  10366:                 files. As in the build-target, <code class=
                   10367:                 "varname">$MAKE_PROGRAM</code> is invoked on
                   10368:                 <code class="varname">$MAKEFILE</code> here, but
                   10369:                 with the <code class=
                   10370:                 "varname">$INSTALL_TARGET</code> instead, the
                   10371:                 latter defaulting to &#8220;<span class=
                   10372:                 "quote">install</span>&#8221; (plus
                   10373:                 &#8220;<span class=
                   10374:                 "quote">install.man</span>&#8221;, if <code class=
                   10375:                 "varname">USE_IMAKE</code> is set).</p>
1.1       grant    10376:               </dd>
                   10377:             </dl>
                   10378:           </div>
                   10379: 
                   10380:           <p>If no target is specified, the default is
                   10381:           &#8220;<span class="quote">build</span>&#8221;. If a
                   10382:           subsequent stage is requested, all prior stages are made:
1.14      xtraeme  10383:           e.g. <span><strong class="command">make
                   10384:           build</strong></span> will also perform the equivalent
                   10385:           of:</p>
1.1       grant    10386:           <pre class="programlisting">
1.51      rillig   10387:     make fetch
                   10388:     make checksum
                   10389:     make extract
                   10390:     make patch
                   10391:     make configure
                   10392:     make build
1.1       grant    10393: </pre>
                   10394:         </div>
                   10395: 
1.52      tv       10396:         <div class="sect1" lang="en">
1.1       grant    10397:           <div class="titlepage">
                   10398:             <div>
                   10399:               <div>
                   10400:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    10401:                 "build.helpful-targets"></a>14.3.&nbsp;Other
1.1       grant    10402:                 helpful targets</h2>
                   10403:               </div>
                   10404:             </div>
                   10405:           </div>
                   10406: 
                   10407:           <div class="variablelist">
                   10408:             <dl>
                   10409:               <dt><span class="term">pre/post-*</span></dt>
                   10410: 
                   10411:               <dd>
                   10412:                 <p>For any of the main targets described in the
                   10413:                 previous section, two auxiliary targets exist with
                   10414:                 &#8220;<span class="quote">pre-</span>&#8221; and
                   10415:                 &#8220;<span class="quote">post-</span>&#8221; used
                   10416:                 as a prefix for the main target's name. These
                   10417:                 targets are invoked before and after the main
                   10418:                 target is called, allowing extra configuration or
                   10419:                 installation steps be performed from a package's
                   10420:                 Makefile, for example, which a program's configure
                   10421:                 script or install target omitted.</p>
                   10422:               </dd>
                   10423: 
                   10424:               <dt><span class="term">do-*</span></dt>
                   10425: 
                   10426:               <dd>
                   10427:                 <p>Should one of the main targets do the wrong
                   10428:                 thing, and should there be no variable to fix this,
                   10429:                 you can redefine it with the do-* target. (Note
                   10430:                 that redefining the target itself instead of the
                   10431:                 do-* target is a bad idea, as the pre-* and post-*
                   10432:                 targets won't be called anymore, etc.) You will not
                   10433:                 usually need to do this.</p>
                   10434:               </dd>
                   10435: 
                   10436:               <dt><span class="term">reinstall</span></dt>
                   10437: 
                   10438:               <dd>
1.14      xtraeme  10439:                 <p>If you did a <span><strong class="command">make
                   10440:                 install</strong></span> and you noticed some file
                   10441:                 was not installed properly, you can repeat the
1.1       grant    10442:                 installation with this target, which will ignore
                   10443:                 the &#8220;<span class="quote">already
                   10444:                 installed</span>&#8221; flag.</p>
                   10445:               </dd>
                   10446: 
                   10447:               <dt><span class="term">deinstall</span></dt>
                   10448: 
                   10449:               <dd>
1.24      wiz      10450:                 <p>This target does a <a href=
                   10451:                 "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1+NetBSD-current">
                   10452:                 <span class="citerefentry"><span class=
                   10453:                 "refentrytitle">pkg_delete</span>(1)</span></a> in
                   10454:                 the current directory, effectively de-installing
                   10455:                 the package. The following variables can be used to
                   10456:                 tune the behaviour:</p>
1.1       grant    10457: 
                   10458:                 <div class="variablelist">
                   10459:                   <dl>
1.14      xtraeme  10460:                     <dt><span class="term"><code class=
                   10461:                     "varname">PKG_VERBOSE</code></span></dt>
1.1       grant    10462: 
                   10463:                     <dd>
                   10464:                       <p>Add a "-v" to the <a href=
                   10465:                       "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1+NetBSD-current">
                   10466:                       <span class="citerefentry"><span class=
                   10467:                       "refentrytitle">pkg_delete</span>(1)</span></a>
                   10468:                       command.</p>
                   10469:                     </dd>
                   10470: 
1.14      xtraeme  10471:                     <dt><span class="term"><code class=
                   10472:                     "varname">DEINSTALLDEPENDS</code></span></dt>
1.1       grant    10473: 
                   10474:                     <dd>
                   10475:                       <p>Remove all packages that require (depend
                   10476:                       on) the given package. This can be used to
                   10477:                       remove any packages that may have been pulled
                   10478:                       in by a given package, e.g. if
1.14      xtraeme  10479:                       <span><strong class="command">make deinstall
                   10480:                       DEINSTALLDEPENDS=1</strong></span> is done in
1.45      wiz      10481:                       <code xmlns=
                   10482:                       "http://www.w3.org/TR/xhtml1/transitional"
                   10483:                       class="filename">pkgsrc/x11/kde</code>, this
                   10484:                       is likely to remove whole KDE. Works by
1.1       grant    10485:                       adding &#8220;<span class=
                   10486:                       "quote">-R</span>&#8221; to the <a href=
                   10487:                       "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1+NetBSD-current">
                   10488:                       <span class="citerefentry"><span class=
                   10489:                       "refentrytitle">pkg_delete</span>(1)</span></a>
                   10490:                       command line.</p>
                   10491:                     </dd>
                   10492:                   </dl>
                   10493:                 </div>
                   10494:               </dd>
                   10495: 
                   10496:               <dt><span class="term">update</span></dt>
                   10497: 
                   10498:               <dd>
                   10499:                 <p>This target causes the current package to be
                   10500:                 updated to the latest version. The package and all
                   10501:                 depending packages first get de-installed, then
                   10502:                 current versions of the corresponding packages get
                   10503:                 compiled and installed. This is similar to manually
                   10504:                 noting which packages are currently installed, then
1.14      xtraeme  10505:                 performing a series of <span><strong class=
                   10506:                 "command">make deinstall</strong></span> and
                   10507:                 <span><strong class="command">make
                   10508:                 install</strong></span> (or whatever <code class=
                   10509:                 "varname">UPDATE_TARGET</code> is set to) for these
                   10510:                 packages.</p>
1.1       grant    10511: 
                   10512:                 <p>You can use the &#8220;<span class=
                   10513:                 "quote">update</span>&#8221; target to resume
1.14      xtraeme  10514:                 package updating in case a previous
                   10515:                 <span><strong class="command">make
                   10516:                 update</strong></span> was interrupted for some
                   10517:                 reason. However, in this case, make sure you don't
                   10518:                 call <span><strong class="command">make
                   10519:                 clean</strong></span> or otherwise remove the list
                   10520:                 of dependent packages in <code class=
1.47      reed     10521:                 "varname">WRKDIR</code>. Otherwise, you lose the
1.1       grant    10522:                 ability to automatically update the current package
                   10523:                 along with the dependent packages you have
                   10524:                 installed.</p>
                   10525: 
1.14      xtraeme  10526:                 <p>Resuming an interrupted <span><strong class=
                   10527:                 "command">make update</strong></span> will only
                   10528:                 work as long as the package tree remains unchanged.
                   10529:                 If the source code for one of the packages to be
                   10530:                 updated has been changed, resuming
                   10531:                 <span><strong class="command">make
                   10532:                 update</strong></span> will most certainly
                   10533:                 fail!</p>
1.1       grant    10534: 
                   10535:                 <p>The following variables can be used either on
1.45      wiz      10536:                 the command line or in <code xmlns=
                   10537:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10538:                 "filename">/etc/mk.conf</code> to alter the
                   10539:                 behaviour of <span><strong class="command">make
                   10540:                 update</strong></span>:</p>
1.1       grant    10541: 
                   10542:                 <div class="variablelist">
                   10543:                   <dl>
1.14      xtraeme  10544:                     <dt><span class="term"><code class=
                   10545:                     "varname">UPDATE_TARGET</code></span></dt>
1.1       grant    10546: 
                   10547:                     <dd>
                   10548:                       <p>Install target to recursively use for the
                   10549:                       updated package and the dependent packages.
1.14      xtraeme  10550:                       Defaults to <code class=
                   10551:                       "varname">DEPENDS_TARGET</code> if set,
1.1       grant    10552:                       &#8220;<span class=
                   10553:                       "quote">install</span>&#8221; otherwise for
1.14      xtraeme  10554:                       <span><strong class="command">make
                   10555:                       update</strong></span>. e.g.
                   10556:                       <span><strong class="command">make update
                   10557:                       UPDATE_TARGET=package</strong></span></p>
1.1       grant    10558:                     </dd>
                   10559: 
1.14      xtraeme  10560:                     <dt><span class="term"><code class=
                   10561:                     "varname">NOCLEAN</code></span></dt>
1.1       grant    10562: 
                   10563:                     <dd>
                   10564:                       <p>Don't clean up after updating. Useful if
                   10565:                       you want to leave the work sources of the
                   10566:                       updated packages around for inspection or
                   10567:                       other purposes. Be sure you eventually clean
                   10568:                       up the source tree (see the
                   10569:                       &#8220;<span class=
                   10570:                       "quote">clean-update</span>&#8221; target
                   10571:                       below) or you may run into troubles with old
                   10572:                       source code still lying around on your next
1.14      xtraeme  10573:                       <span><strong class=
                   10574:                       "command">make</strong></span> or
                   10575:                       <span><strong class="command">make
                   10576:                       update</strong></span>.</p>
1.1       grant    10577:                     </dd>
                   10578: 
1.14      xtraeme  10579:                     <dt><span class="term"><code class=
                   10580:                     "varname">REINSTALL</code></span></dt>
1.1       grant    10581: 
                   10582:                     <dd>
                   10583:                       <p>Deinstall each package before installing
1.14      xtraeme  10584:                       (making <code class=
                   10585:                       "varname">DEPENDS_TARGET</code>). This may be
1.1       grant    10586:                       necessary if the &#8220;<span class=
                   10587:                       "quote">clean-update</span>&#8221; target
                   10588:                       (see below) was called after interrupting a
1.14      xtraeme  10589:                       running <span><strong class="command">make
                   10590:                       update</strong></span>.</p>
1.1       grant    10591:                     </dd>
                   10592: 
1.14      xtraeme  10593:                     <dt><span class="term"><code class=
                   10594:                     "varname">DEPENDS_TARGET</code></span></dt>
1.1       grant    10595: 
                   10596:                     <dd>
                   10597:                       <p>Allows you to disable recursion and
                   10598:                       hardcode the target for packages. The default
                   10599:                       is &#8220;<span class=
                   10600:                       "quote">update</span>&#8221; for the update
                   10601:                       target, facilitating a recursive update of
1.14      xtraeme  10602:                       prerequisite packages. Only set <code class=
                   10603:                       "varname">DEPENDS_TARGET</code> if you want
                   10604:                       to disable recursive updates. Use
                   10605:                       <code class="varname">UPDATE_TARGET</code>
                   10606:                       instead to just set a specific target for
                   10607:                       each package to be installed during
                   10608:                       <span><strong class="command">make
                   10609:                       update</strong></span> (see above).</p>
1.1       grant    10610:                     </dd>
                   10611:                   </dl>
                   10612:                 </div>
                   10613:               </dd>
                   10614: 
                   10615:               <dt><span class="term">clean-update</span></dt>
                   10616: 
                   10617:               <dd>
                   10618:                 <p>Clean the source tree for all packages that
1.14      xtraeme  10619:                 would get updated if <span><strong class=
                   10620:                 "command">make update</strong></span> was called
                   10621:                 from the current directory. This target should not
                   10622:                 be used if the current package (or any of its
                   10623:                 depending packages) have already been de-installed
                   10624:                 (e.g., after calling <span><strong class=
                   10625:                 "command">make update</strong></span>) or you may
                   10626:                 lose some packages you intended to update. As a
                   10627:                 rule of thumb: only use this target <span class=
                   10628:                 "emphasis"><em>before</em></span> the first time
                   10629:                 you run <span><strong class="command">make
                   10630:                 update</strong></span> and only if you have a dirty
                   10631:                 package tree (e.g., if you used <code class=
                   10632:                 "varname">NOCLEAN</code>).</p>
1.1       grant    10633: 
1.47      reed     10634:                 <p>If you are unsure about whether your tree is
                   10635:                 clean, you can either perform a
1.14      xtraeme  10636:                 <span><strong class="command">make
1.47      reed     10637:                 clean</strong></span> at the top of the tree, or
                   10638:                 use the following sequence of commands from the
                   10639:                 directory of the package you want to update
                   10640:                 (<span class="emphasis"><em>before</em></span>
                   10641:                 running <span><strong class="command">make
1.14      xtraeme  10642:                 update</strong></span> for the first time,
                   10643:                 otherwise you lose all the packages you wanted to
                   10644:                 update!):</p>
1.1       grant    10645:                 <pre class="screen">
1.14      xtraeme  10646: <code class="prompt">#</code> <strong class=
                   10647: "userinput"><code>make clean-update</code></strong>
                   10648: <code class="prompt">#</code> <strong class=
                   10649: "userinput"><code>make clean CLEANDEPENDS=YES</code></strong>
                   10650: <code class="prompt">#</code> <strong class=
                   10651: "userinput"><code>make update</code></strong>
1.1       grant    10652: </pre>
                   10653: 
                   10654:                 <p>The following variables can be used either on
1.45      wiz      10655:                 the command line or in <code xmlns=
                   10656:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10657:                 "filename">/etc/mk.conf</code> to alter the
                   10658:                 behaviour of <span><strong class="command">make
                   10659:                 clean-update</strong></span>:</p>
1.1       grant    10660: 
                   10661:                 <div class="variablelist">
                   10662:                   <dl>
1.14      xtraeme  10663:                     <dt><span class="term"><code class=
                   10664:                     "varname">CLEAR_DIRLIST</code></span></dt>
1.1       grant    10665: 
                   10666:                     <dd>
1.14      xtraeme  10667:                       <p>After <span><strong class="command">make
                   10668:                       clean</strong></span>, do not reconstruct the
                   10669:                       list of directories to update for this
                   10670:                       package. Only use this if
                   10671:                       <span><strong class="command">make
                   10672:                       update</strong></span> successfully installed
                   10673:                       all packages you wanted to update. Normally,
                   10674:                       this is done automatically on
                   10675:                       <span><strong class="command">make
                   10676:                       update</strong></span>, but may have been
                   10677:                       suppressed by the <code class=
                   10678:                       "varname">NOCLEAN</code> variable (see
1.1       grant    10679:                       above).</p>
                   10680:                     </dd>
                   10681:                   </dl>
                   10682:                 </div>
                   10683:               </dd>
                   10684: 
                   10685:               <dt><span class="term">info</span></dt>
                   10686: 
                   10687:               <dd>
                   10688:                 <p>This target invokes <a href=
                   10689:                 "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_info+1+NetBSD-current">
                   10690:                 <span class="citerefentry"><span class=
                   10691:                 "refentrytitle">pkg_info</span>(1)</span></a> for
                   10692:                 the current package. You can use this to check
                   10693:                 which version of a package is installed.</p>
                   10694:               </dd>
                   10695: 
                   10696:               <dt><span class="term">readme</span></dt>
                   10697: 
                   10698:               <dd>
1.45      wiz      10699:                 <p>This target generates a <code xmlns=
                   10700:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10701:                 "filename">README.html</code> file, which can be
1.1       grant    10702:                 viewed using a browser such as <a xmlns=
                   10703:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   10704:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/mozilla/README.html"
1.45      wiz      10705:                 target="_top"><code xmlns="" class=
                   10706:                 "filename">www/mozilla</code></a> or <a xmlns=
1.20      ben      10707:                 "http://www.w3.org/TR/xhtml1/transitional" href=
                   10708:                 "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/links/README.html"
1.45      wiz      10709:                 target="_top"><code xmlns="" class=
                   10710:                 "filename">www/links</code></a>. The generated
                   10711:                 files contain references to any packages which are
                   10712:                 in the <code class="varname">PACKAGES</code>
                   10713:                 directory on the local host. The generated files
                   10714:                 can be made to refer to URLs based on <code class=
1.20      ben      10715:                 "varname">FTP_PKG_URL_HOST</code> and <code class=
                   10716:                 "varname">FTP_PKG_URL_DIR</code>. For example, if I
1.45      wiz      10717:                 wanted to generate <code xmlns=
                   10718:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.20      ben      10719:                 "filename">README.html</code> files which pointed
                   10720:                 to binary packages on the local machine, in the
1.45      wiz      10721:                 directory <code xmlns=
                   10722:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.20      ben      10723:                 "filename">/usr/packages</code>, set <code class=
                   10724:                 "varname">FTP_PKG_URL_HOST=file://localhost</code>
                   10725:                 and <code class=
                   10726:                 "varname">FTP_PKG_URL_DIR=/usr/packages</code>. The
                   10727:                 <code class="varname">${PACKAGES}</code> directory
                   10728:                 and its subdirectories will be searched for all the
                   10729:                 binary packages.</p>
1.1       grant    10730:               </dd>
                   10731: 
                   10732:               <dt><span class="term">readme-all</span></dt>
                   10733: 
                   10734:               <dd>
1.45      wiz      10735:                 <p>Use this target to create a file <code xmlns=
                   10736:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10737:                 "filename">README-all.html</code> which contains a
1.1       grant    10738:                 list of all packages currently available in the
                   10739:                 NetBSD Packages Collection, together with the
                   10740:                 category they belong to and a short description.
1.45      wiz      10741:                 This file is compiled from the <code xmlns=
                   10742:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10743:                 "filename">pkgsrc/*/README.html</code> files, so be
1.1       grant    10744:                 sure to run this <span class=
1.14      xtraeme  10745:                 "emphasis"><em>after</em></span> a
                   10746:                 <span><strong class="command">make
                   10747:                 readme</strong></span>.</p>
1.1       grant    10748:               </dd>
                   10749: 
                   10750:               <dt><span class="term">cdrom-readme</span></dt>
                   10751: 
                   10752:               <dd>
                   10753:                 <p>This is very much the same as the
                   10754:                 &#8220;<span class="quote">readme</span>&#8221;
                   10755:                 target (see above), but is to be used when
                   10756:                 generating a pkgsrc tree to be written to a CD-ROM.
1.45      wiz      10757:                 This target also produces <code xmlns=
                   10758:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10759:                 "filename">README.html</code> files, and can be
                   10760:                 made to refer to URLs based on <code class=
                   10761:                 "varname">CDROM_PKG_URL_HOST</code> and
                   10762:                 <code class="varname">CDROM_PKG_URL_DIR</code>.</p>
1.1       grant    10763:               </dd>
                   10764: 
                   10765:               <dt><span class="term">show-distfiles</span></dt>
                   10766: 
                   10767:               <dd>
                   10768:                 <p>This target shows which distfiles and patchfiles
1.14      xtraeme  10769:                 are needed to build the package. (<code class=
                   10770:                 "varname">DISTFILES</code> and <code class=
1.45      wiz      10771:                 "varname">PATCHFILES</code>, but not <code xmlns=
                   10772:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10773:                 "filename">patches/*</code>)</p>
1.1       grant    10774:               </dd>
                   10775: 
                   10776:               <dt><span class="term">show-downlevel</span></dt>
                   10777: 
                   10778:               <dd>
                   10779:                 <p>This target shows nothing if the package is not
                   10780:                 installed. If a version of this package is
                   10781:                 installed, but is not the version provided in this
                   10782:                 version of pkgsrc, then a warning message is
                   10783:                 displayed. This target can be used to show which of
                   10784:                 your installed packages are downlevel, and so the
                   10785:                 old versions can be deleted, and the current ones
                   10786:                 added.</p>
                   10787:               </dd>
                   10788: 
                   10789:               <dt><span class="term">show-pkgsrc-dir</span></dt>
                   10790: 
                   10791:               <dd>
                   10792:                 <p>This target shows the directory in the pkgsrc
                   10793:                 hierarchy from which the package can be built and
                   10794:                 installed. This may not be the same directory as
                   10795:                 the one from which the package was installed. This
                   10796:                 target is intended to be used by people who may
                   10797:                 wish to upgrade many packages on a single host, and
                   10798:                 can be invoked from the top-level pkgsrc Makefile
                   10799:                 by using the &#8220;<span class=
                   10800:                 "quote">show-host-specific-pkgs</span>&#8221;
                   10801:                 target.</p>
                   10802:               </dd>
                   10803: 
                   10804:               <dt><span class=
                   10805:               "term">show-installed-depends</span></dt>
                   10806: 
                   10807:               <dd>
                   10808:                 <p>This target shows which installed packages match
1.14      xtraeme  10809:                 the current package's <code class=
                   10810:                 "varname">DEPENDS</code>. Useful if out of date
1.1       grant    10811:                 dependencies are causing build problems.</p>
                   10812:               </dd>
                   10813: 
                   10814:               <dt><span class="term">check-shlibs</span></dt>
                   10815: 
                   10816:               <dd>
                   10817:                 <p>After a package is installed, check all its
                   10818:                 binaries and (on ELF platforms) shared libraries to
                   10819:                 see if they find the shared libs they need. Run by
1.14      xtraeme  10820:                 default if <code class=
                   10821:                 "varname">PKG_DEVELOPER</code> is set in
1.45      wiz      10822:                 <code xmlns=
                   10823:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10824:                 "filename">/etc/mk.conf</code>.</p>
1.1       grant    10825:               </dd>
                   10826: 
                   10827:               <dt><span class="term">print-PLIST</span></dt>
                   10828: 
                   10829:               <dd>
                   10830:                 <p>After a &#8220;<span class="quote">make
                   10831:                 install</span>&#8221; from a new or upgraded pkg,
                   10832:                 this prints out an attempt to generate a new
1.45      wiz      10833:                 <code xmlns=
                   10834:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10835:                 "filename">PLIST</code> from a <span><strong class=
                   10836:                 "command">find -newer
1.14      xtraeme  10837:                 work/.extract_done</strong></span>. An attempt is
                   10838:                 made to care for shared libs etc., but it is
1.1       grant    10839:                 <span class="emphasis"><em>strongly</em></span>
                   10840:                 recommended to review the result before putting it
1.45      wiz      10841:                 into <code xmlns=
                   10842:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10843:                 "filename">PLIST</code>. On upgrades, it's useful
                   10844:                 to diff the output of this command against an
                   10845:                 already existing <code xmlns=
                   10846:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  10847:                 "filename">PLIST</code> file.</p>
1.1       grant    10848: 
1.24      wiz      10849:                 <p>If the package installs files via <a href=
                   10850:                 "http://netbsd.gw.com/cgi-bin/man-cgi?tar+1+NetBSD-current">
                   10851:                 <span class="citerefentry"><span class=
                   10852:                 "refentrytitle">tar</span>(1)</span></a> or other
                   10853:                 methods that don't update file access times, be
                   10854:                 sure to add these files manually to your
1.45      wiz      10855:                 <code xmlns=
                   10856:                 "http://www.w3.org/TR/xhtml1/transitional" class=
                   10857:                 "filename">PLIST</code>, as the &#8220;<span class=
                   10858:                 "quote">find -newer</span>&#8221; command used by
                   10859:                 this target won't catch them!</p>
1.1       grant    10860: 
                   10861:                 <p>See <a href="#print-PLIST" title=
1.38      dillo    10862:                 "10.3.&nbsp;Tweaking output of make print-PLIST">Section&nbsp;10.3,
1.14      xtraeme  10863:                 &#8220;Tweaking output of <span><strong class=
                   10864:                 "command">make
                   10865:                 print-PLIST</strong></span>&#8221;</a> for more
                   10866:                 information on this target.</p>
1.1       grant    10867:               </dd>
                   10868: 
                   10869:               <dt><span class="term">bulk-package</span></dt>
                   10870: 
                   10871:               <dd>
                   10872:                 <p>Used to do bulk builds. If an appropriate binary
                   10873:                 package already exists, no action is taken. If not,
                   10874:                 this target will compile, install and package it
1.47      reed     10875:                 (and its depends, if <code class=
1.14      xtraeme  10876:                 "varname">PKG_DEPENDS</code> is set properly. See
1.1       grant    10877:                 <a href="#binary.configuration" title=
1.38      dillo    10878:                 "6.3.1.&nbsp;Configuration">Section&nbsp;6.3.1,
1.47      reed     10879:                 &#8220;Configuration&#8221;</a>). After creating
                   10880:                 the binary package, the sources, the just-installed
                   10881:                 package and its required packages are removed,
1.1       grant    10882:                 preserving free disk space.</p>
                   10883: 
                   10884:                 <p><span class="emphasis"><em>Beware that this
                   10885:                 target may deinstall all packages installed on a
                   10886:                 system!</em></span></p>
                   10887:               </dd>
                   10888: 
                   10889:               <dt><span class="term">bulk-install</span></dt>
                   10890: 
                   10891:               <dd>
                   10892:                 <p>Used during bulk-installs to install required
1.47      reed     10893:                 packages. If an up-to-date binary package is
1.1       grant    10894:                 available, it will be installed via <a href=
                   10895:                 "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current">
                   10896:                 <span class="citerefentry"><span class=
                   10897:                 "refentrytitle">pkg_add</span>(1)</span></a>. If
1.14      xtraeme  10898:                 not, <span><strong class="command">make
                   10899:                 bulk-package</strong></span> will be executed, but
1.47      reed     10900:                 the installed binary won't be removed.</p>
1.1       grant    10901: 
                   10902:                 <p>A binary package is considered
1.47      reed     10903:                 &#8220;<span class="quote">up-to-date</span>&#8221;
1.1       grant    10904:                 to be installed via <a href=
                   10905:                 "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current">
                   10906:                 <span class="citerefentry"><span class=
                   10907:                 "refentrytitle">pkg_add</span>(1)</span></a>
                   10908:                 if:</p>
                   10909: 
                   10910:                 <div class="itemizedlist">
                   10911:                   <ul type="disc">
                   10912:                     <li>
1.45      wiz      10913:                       <p>None of the package's files (<code xmlns=
                   10914:                       "http://www.w3.org/TR/xhtml1/transitional"
                   10915:                       class="filename">Makefile</code>, ...) were
1.14      xtraeme  10916:                       modified since it was built.</p>
1.1       grant    10917:                     </li>
                   10918: 
                   10919:                     <li>
                   10920:                       <p>None of the package's required (binary)
                   10921:                       packages were modified since it was
                   10922:                       built.</p>
                   10923:                     </li>
                   10924:                   </ul>
                   10925:                 </div>
                   10926: 
                   10927:                 <p><span class="emphasis"><em>Beware that this
                   10928:                 target may deinstall all packages installed on a
                   10929:                 system!</em></span></p>
                   10930:               </dd>
                   10931:             </dl>
                   10932:           </div>
                   10933:         </div>
                   10934:       </div>
                   10935: 
1.52      tv       10936:       <div class="chapter" lang="en">
1.1       grant    10937:         <div class="titlepage">
                   10938:           <div>
                   10939:             <div>
1.52      tv       10940:               <h2 class="title"><a name=
1.38      dillo    10941:               "fixes"></a>Chapter&nbsp;15.&nbsp;Notes on fixes for
1.1       grant    10942:               packages</h2>
                   10943:             </div>
                   10944:           </div>
                   10945:         </div>
                   10946: 
                   10947:         <div class="toc">
                   10948:           <p><b>Table of Contents</b></p>
                   10949: 
                   10950:           <dl>
1.30      wiz      10951:             <dt><span class="sect1"><a href=
1.38      dillo    10952:             "#general-operation">15.1. General
1.30      wiz      10953:             operation</a></span></dt>
1.1       grant    10954: 
                   10955:             <dd>
                   10956:               <dl>
                   10957:                 <dt><span class="sect2"><a href=
1.38      dillo    10958:                 "#pulling-vars-from-etc-mk.conf">15.1.1. How to
1.30      wiz      10959:                 pull in variables from /etc/mk.conf</a></span></dt>
1.1       grant    10960: 
                   10961:                 <dt><span class="sect2"><a href=
1.38      dillo    10962:                 "#where-to-install-documentation">15.1.2. Where to
1.31      wiz      10963:                 install documentation</a></span></dt>
                   10964: 
                   10965:                 <dt><span class="sect2"><a href=
1.38      dillo    10966:                 "#restricted-packages">15.1.3. Restricted
1.1       grant    10967:                 packages</a></span></dt>
                   10968: 
                   10969:                 <dt><span class="sect2"><a href=
1.38      dillo    10970:                 "#dependencies">15.1.4. Handling
1.1       grant    10971:                 dependencies</a></span></dt>
                   10972: 
                   10973:                 <dt><span class="sect2"><a href=
1.38      dillo    10974:                 "#conflicts">15.1.5. Handling conflicts with other
1.1       grant    10975:                 packages</a></span></dt>
                   10976: 
                   10977:                 <dt><span class="sect2"><a href=
1.38      dillo    10978:                 "#not-building-packages">15.1.6. Packages that
1.30      wiz      10979:                 cannot or should not be built</a></span></dt>
1.1       grant    10980: 
                   10981:                 <dt><span class="sect2"><a href=
1.38      dillo    10982:                 "#undeletable-packages">15.1.7. Packages which
1.30      wiz      10983:                 should not be deleted, once
                   10984:                 installed</a></span></dt>
1.1       grant    10985: 
                   10986:                 <dt><span class="sect2"><a href=
1.38      dillo    10987:                 "#security-handling">15.1.8. Handling packages with
1.1       grant    10988:                 security problems</a></span></dt>
                   10989: 
                   10990:                 <dt><span class="sect2"><a href=
1.38      dillo    10991:                 "#compiler-bugs">15.1.9. How to handle compiler
1.1       grant    10992:                 bugs</a></span></dt>
                   10993: 
                   10994:                 <dt><span class="sect2"><a href=
1.38      dillo    10995:                 "#bumping-pkgrevision">15.1.10. How to handle
1.30      wiz      10996:                 incrementing versions when fixing an existing
1.1       grant    10997:                 package</a></span></dt>
                   10998: 
                   10999:                 <dt><span class="sect2"><a href=
1.38      dillo    11000:                 "#portability-of-packages">15.1.11. Portability of
1.1       grant    11001:                 packages</a></span></dt>
                   11002:               </dl>
                   11003:             </dd>
                   11004: 
1.30      wiz      11005:             <dt><span class="sect1"><a href=
1.38      dillo    11006:             "#downloading-issues">15.2. Possible downloading
1.30      wiz      11007:             issues</a></span></dt>
1.1       grant    11008: 
                   11009:             <dd>
                   11010:               <dl>
                   11011:                 <dt><span class="sect2"><a href=
1.38      dillo    11012:                 "#no-plain-download">15.2.1. Packages whose
1.30      wiz      11013:                 distfiles aren't available for plain
1.1       grant    11014:                 downloading</a></span></dt>
                   11015: 
                   11016:                 <dt><span class="sect2"><a href=
1.38      dillo    11017:                 "#modified-distfiles-same-name">15.2.2. How to
1.30      wiz      11018:                 handle modified distfiles with the 'old'
                   11019:                 name</a></span></dt>
1.1       grant    11020:               </dl>
                   11021:             </dd>
                   11022: 
1.30      wiz      11023:             <dt><span class="sect1"><a href=
1.38      dillo    11024:             "#configuration-gotchas">15.3. Configuration
1.30      wiz      11025:             gotchas</a></span></dt>
1.1       grant    11026: 
                   11027:             <dd>
                   11028:               <dl>
                   11029:                 <dt><span class="sect2"><a href=
1.38      dillo    11030:                 "#fixes.libtool">15.3.1. Shared libraries -
1.1       grant    11031:                 libtool</a></span></dt>
                   11032: 
                   11033:                 <dt><span class="sect2"><a href=
1.38      dillo    11034:                 "#using-libtool">15.3.2. Using libtool on GNU
1.30      wiz      11035:                 packages that already support
                   11036:                 libtool</a></span></dt>
1.1       grant    11037: 
                   11038:                 <dt><span class="sect2"><a href=
1.38      dillo    11039:                 "#autoconf-automake">15.3.3. GNU
1.1       grant    11040:                 Autoconf/Automake</a></span></dt>
                   11041:               </dl>
                   11042:             </dd>
                   11043: 
1.30      wiz      11044:             <dt><span class="sect1"><a href=
1.38      dillo    11045:             "#building-considerations">15.4. Building
1.30      wiz      11046:             considerations</a></span></dt>
1.1       grant    11047: 
                   11048:             <dd>
                   11049:               <dl>
                   11050:                 <dt><span class="sect2"><a href=
1.38      dillo    11051:                 "#cpp-defines">15.4.1. CPP defines</a></span></dt>
1.51      rillig   11052: 
                   11053:                 <dt><span class="sect2"><a href="#cpp-list">15.4.2.
                   11054:                 Getting a list of CPP defines</a></span></dt>
1.1       grant    11055:               </dl>
                   11056:             </dd>
                   11057: 
1.30      wiz      11058:             <dt><span class="sect1"><a href=
1.38      dillo    11059:             "#package-specific-actions">15.5. Package specific
1.30      wiz      11060:             actions</a></span></dt>
1.1       grant    11061: 
                   11062:             <dd>
                   11063:               <dl>
                   11064:                 <dt><span class="sect2"><a href=
1.38      dillo    11065:                 "#user-interaction">15.5.1. User
1.2       hubertf  11066:                 interaction</a></span></dt>
1.1       grant    11067: 
                   11068:                 <dt><span class="sect2"><a href=
1.38      dillo    11069:                 "#handling-licenses">15.5.2. Handling
1.1       grant    11070:                 licenses</a></span></dt>
                   11071: 
                   11072:                 <dt><span class="sect2"><a href=
1.38      dillo    11073:                 "#installing-score-files">15.5.3. Installing score
1.1       grant    11074:                 files</a></span></dt>
                   11075: 
                   11076:                 <dt><span class="sect2"><a href=
1.38      dillo    11077:                 "#perl-scripts">15.5.4. Packages containing perl
1.1       grant    11078:                 scripts</a></span></dt>
                   11079: 
                   11080:                 <dt><span class="sect2"><a href=
1.38      dillo    11081:                 "#hardcoded-paths">15.5.5. Packages with hardcoded
1.30      wiz      11082:                 paths to other interpreters</a></span></dt>
1.1       grant    11083: 
                   11084:                 <dt><span class="sect2"><a href=
1.38      dillo    11085:                 "#perl-modules">15.5.6. Packages installing perl
1.1       grant    11086:                 modules</a></span></dt>
                   11087: 
                   11088:                 <dt><span class="sect2"><a href=
1.38      dillo    11089:                 "#faq.info-files">15.5.7. Packages installing info
1.1       grant    11090:                 files</a></span></dt>
                   11091: 
                   11092:                 <dt><span class="sect2"><a href=
1.38      dillo    11093:                 "#gconf2-data-files">15.5.8. Packages installing
1.30      wiz      11094:                 GConf2 data files</a></span></dt>
1.1       grant    11095: 
                   11096:                 <dt><span class="sect2"><a href=
1.38      dillo    11097:                 "#scrollkeeper-data-files">15.5.9. Packages
1.30      wiz      11098:                 installing scrollkeeper data files</a></span></dt>
1.1       grant    11099: 
                   11100:                 <dt><span class="sect2"><a href=
1.38      dillo    11101:                 "#x11-fonts">15.5.10. Packages installing X11
1.1       grant    11102:                 fonts</a></span></dt>
                   11103: 
                   11104:                 <dt><span class="sect2"><a href=
1.38      dillo    11105:                 "#gtk2-modules">15.5.11. Packages installing GTK2
1.1       grant    11106:                 modules</a></span></dt>
                   11107: 
                   11108:                 <dt><span class="sect2"><a href=
1.38      dillo    11109:                 "#sgml-xml-data">15.5.12. Packages installing SGML
1.30      wiz      11110:                 or XML data</a></span></dt>
1.1       grant    11111: 
                   11112:                 <dt><span class="sect2"><a href=
1.38      dillo    11113:                 "#mime-database">15.5.13. Packages installing
1.1       grant    11114:                 extensions to the MIME database</a></span></dt>
                   11115: 
                   11116:                 <dt><span class="sect2"><a href=
1.38      dillo    11117:                 "#intltool">15.5.14. Packages using
1.1       grant    11118:                 intltool</a></span></dt>
1.18      xtraeme  11119: 
                   11120:                 <dt><span class="sect2"><a href=
1.38      dillo    11121:                 "#startup-scripts">15.5.15. Packages installing
1.30      wiz      11122:                 startup scripts</a></span></dt>
1.1       grant    11123:               </dl>
                   11124:             </dd>
                   11125: 
1.30      wiz      11126:             <dt><span class="sect1"><a href=
1.38      dillo    11127:             "#feedback-to-author">15.6. Feedback to the
1.30      wiz      11128:             author</a></span></dt>
1.1       grant    11129:           </dl>
                   11130:         </div>
                   11131: 
1.52      tv       11132:         <div class="sect1" lang="en">
1.1       grant    11133:           <div class="titlepage">
                   11134:             <div>
                   11135:               <div>
                   11136:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    11137:                 "general-operation"></a>15.1.&nbsp;General
1.1       grant    11138:                 operation</h2>
                   11139:               </div>
                   11140:             </div>
                   11141:           </div>
                   11142: 
1.52      tv       11143:           <div class="sect2" lang="en">
1.1       grant    11144:             <div class="titlepage">
                   11145:               <div>
                   11146:                 <div>
1.30      wiz      11147:                   <h3 class="title"><a name=
1.38      dillo    11148:                   "pulling-vars-from-etc-mk.conf"></a>15.1.1.&nbsp;How
1.30      wiz      11149:                   to pull in variables from /etc/mk.conf</h3>
1.1       grant    11150:                 </div>
                   11151:               </div>
                   11152:             </div>
                   11153: 
                   11154:             <p>The problem with package-defined variables that can
1.14      xtraeme  11155:             be overridden via <code class="varname">MAKECONF</code>
1.45      wiz      11156:             or <code xmlns=
                   11157:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   11158:             "filename">/etc/mk.conf</code> is that <a href=
1.1       grant    11159:             "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current">
                   11160:             <span class="citerefentry"><span class=
                   11161:             "refentrytitle">make</span>(1)</span></a> expands a
1.47      reed     11162:             variable as it is used, but evaluates preprocessor-like
1.1       grant    11163:             statements (.if, .ifdef and .ifndef) as they are read.
1.14      xtraeme  11164:             So, to use any variable (which may be set in
1.45      wiz      11165:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   11166:             class="filename">/etc/mk.conf</code>) in one of the
                   11167:             .if* statements, the file <code xmlns=
                   11168:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  11169:             "filename">/etc/mk.conf</code> must be included before
1.1       grant    11170:             that .if* statement.</p>
                   11171: 
1.47      reed     11172:             <p>Rather than having a number of ad-hoc ways of
1.45      wiz      11173:             including <code xmlns=
                   11174:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   11175:             "filename">/etc/mk.conf</code>, should it exist, or
                   11176:             <code class="varname">MAKECONF</code>, should it exist,
                   11177:             include the <code xmlns=
                   11178:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   11179:             "filename">pkgsrc/mk/bsd.prefs.mk</code> file in the
                   11180:             package Makefile before any preprocessor-like .if,
                   11181:             .ifdef, or .ifndef statements:</p>
1.1       grant    11182:             <pre class="programlisting">
1.51      rillig   11183:     .include "../../mk/bsd.prefs.mk"
                   11184: 
1.1       grant    11185:     .if defined(USE_MENUS)
1.51      rillig   11186:     # ...
1.1       grant    11187:     .endif
                   11188: </pre>
                   11189: 
1.14      xtraeme  11190:             <p>If you wish to set the <code class=
1.45      wiz      11191:             "varname">CFLAGS</code> variable in <code xmlns=
                   11192:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.47      reed     11193:             "filename">/etc/mk.conf</code>, please make sure to
1.1       grant    11194:             use:</p>
                   11195:             <pre class="programlisting">
1.51      rillig   11196:     CFLAGS+=  -your -flags
1.1       grant    11197: </pre>
                   11198: 
1.14      xtraeme  11199:             <p>Using <code class="varname">CFLAGS=</code> (i.e.
                   11200:             without the &#8220;<span class="quote">+</span>&#8221;)
                   11201:             may lead to problems with packages that need to add
                   11202:             their own flags. Also, you may want to take a look at
                   11203:             the <a xmlns="http://www.w3.org/TR/xhtml1/transitional"
1.1       grant    11204:             href=
                   11205:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/cpuflags/README.html"
1.45      wiz      11206:             target="_top"><code xmlns="" class=
                   11207:             "filename">devel/cpuflags</code></a> package if you're
1.20      ben      11208:             interested in optimization for the current CPU.</p>
1.1       grant    11209:           </div>
                   11210: 
1.52      tv       11211:           <div class="sect2" lang="en">
1.1       grant    11212:             <div class="titlepage">
                   11213:               <div>
                   11214:                 <div>
1.31      wiz      11215:                   <h3 class="title"><a name=
1.38      dillo    11216:                   "where-to-install-documentation"></a>15.1.2.&nbsp;Where
1.31      wiz      11217:                   to install documentation</h3>
                   11218:                 </div>
                   11219:               </div>
                   11220:             </div>
                   11221: 
1.45      wiz      11222:             <p>Documentation should be installed into <code xmlns=
                   11223:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.31      wiz      11224:             "filename">${PREFIX}/share/doc/${PKGBASE}</code> or
1.45      wiz      11225:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   11226:             class="filename">${PREFIX}/share/doc/${PKGNAME}</code>
                   11227:             (the latter includes the version number of the
                   11228:             package).</p>
1.31      wiz      11229:           </div>
                   11230: 
1.52      tv       11231:           <div class="sect2" lang="en">
1.31      wiz      11232:             <div class="titlepage">
                   11233:               <div>
                   11234:                 <div>
1.52      tv       11235:                   <h3 class="title"><a name=
1.38      dillo    11236:                   "restricted-packages"></a>15.1.3.&nbsp;Restricted
1.1       grant    11237:                   packages</h3>
                   11238:                 </div>
                   11239:               </div>
                   11240:             </div>
                   11241: 
                   11242:             <p>Some licenses restrict how software may be
                   11243:             re-distributed. In order to satisfy these restrictions,
                   11244:             the package system defines five make variables that can
                   11245:             be set to note these restrictions:</p>
                   11246: 
                   11247:             <div class="itemizedlist">
                   11248:               <ul type="disc">
                   11249:                 <li>
1.14      xtraeme  11250:                   <p><code class="varname">RESTRICTED</code></p>
1.1       grant    11251: 
                   11252:                   <p>This variable should be set whenever a
                   11253:                   restriction exists (regardless of its kind). Set
                   11254:                   this variable to a string containing the reason
                   11255:                   for the restriction.</p>
                   11256:                 </li>
                   11257: 
                   11258:                 <li>
1.14      xtraeme  11259:                   <p><code class=
                   11260:                   "varname">NO_BIN_ON_CDROM</code></p>
1.1       grant    11261: 
                   11262:                   <p>Binaries may not be placed on CD-ROM. Set this
1.14      xtraeme  11263:                   variable to <code class=
                   11264:                   "varname">${RESTRICTED}</code> whenever a binary
1.1       grant    11265:                   package may not be included on a CD-ROM.</p>
                   11266:                 </li>
                   11267: 
                   11268:                 <li>
1.14      xtraeme  11269:                   <p><code class="varname">NO_BIN_ON_FTP</code></p>
1.1       grant    11270: 
                   11271:                   <p>Binaries may not be placed on an FTP server.
1.14      xtraeme  11272:                   Set this variable to <code class=
                   11273:                   "varname">${RESTRICTED}</code> whenever a binary
1.1       grant    11274:                   package may not not be made available on the
                   11275:                   Internet.</p>
                   11276:                 </li>
                   11277: 
                   11278:                 <li>
1.14      xtraeme  11279:                   <p><code class=
                   11280:                   "varname">NO_SRC_ON_CDROM</code></p>
1.1       grant    11281: 
                   11282:                   <p>Distfiles may not be placed on CD-ROM. Set
1.14      xtraeme  11283:                   this variable to <code class=
                   11284:                   "varname">${RESTRICTED}</code> if re-distribution
1.1       grant    11285:                   of the source code or other distfile(s) is not
                   11286:                   allowed on CD-ROMs.</p>
                   11287:                 </li>
                   11288: 
                   11289:                 <li>
1.14      xtraeme  11290:                   <p><code class="varname">NO_SRC_ON_FTP</code></p>
1.1       grant    11291: 
                   11292:                   <p>Distfiles may not be placed on FTP. Set this
1.14      xtraeme  11293:                   variable to <code class=
                   11294:                   "varname">${RESTRICTED}</code> if re-distribution
1.1       grant    11295:                   of the source code or other distfile(s) via the
                   11296:                   Internet is not allowed.</p>
                   11297:                 </li>
                   11298:               </ul>
                   11299:             </div>
                   11300: 
1.14      xtraeme  11301:             <p>Please note that the use of <code class=
                   11302:             "varname">NO_PACKAGE</code>, <code class=
                   11303:             "varname">IGNORE</code>, <code class=
                   11304:             "varname">NO_CDROM</code>, or other generic make
1.1       grant    11305:             variables to denote restrictions is deprecated, because
                   11306:             they unconditionally prevent users from generating
                   11307:             binary packages!</p>
                   11308:           </div>
                   11309: 
1.52      tv       11310:           <div class="sect2" lang="en">
1.1       grant    11311:             <div class="titlepage">
                   11312:               <div>
                   11313:                 <div>
1.52      tv       11314:                   <h3 class="title"><a name=
1.38      dillo    11315:                   "dependencies"></a>15.1.4.&nbsp;Handling
1.1       grant    11316:                   dependencies</h3>
                   11317:                 </div>
                   11318:               </div>
                   11319:             </div>
                   11320: 
                   11321:             <p>Your package may depend on some other package being
                   11322:             present - and there are various ways of expressing this
1.14      xtraeme  11323:             dependency. pkgsrc supports the <code class=
                   11324:             "varname">BUILD_DEPENDS</code> and <code class=
1.47      reed     11325:             "varname">DEPENDS</code> definitions, the <code class=
                   11326:             "varname">USE_TOOLS</code> definition, as well as
1.45      wiz      11327:             dependencies via <code xmlns=
                   11328:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  11329:             "filename">buildlink3.mk</code>, which is the preferred
1.1       grant    11330:             way to handle dependencies, and which uses the
                   11331:             variables named above. See <a href="#buildlink" title=
1.38      dillo    11332:             "Chapter&nbsp;11.&nbsp;Buildlink methodology">Chapter&nbsp;11,
1.1       grant    11333:             <i>Buildlink methodology</i></a> for more
                   11334:             information.</p>
                   11335: 
                   11336:             <p>The basic difference between the two variables is as
1.14      xtraeme  11337:             follows: The <code class="varname">DEPENDS</code>
1.1       grant    11338:             definition registers that pre-requisite in the binary
                   11339:             package so it will be pulled in when the binary package
1.14      xtraeme  11340:             is later installed, whilst the <code class=
                   11341:             "varname">BUILD_DEPENDS</code> definition does not,
1.1       grant    11342:             marking a dependency that is only needed for building
                   11343:             the package.</p>
                   11344: 
                   11345:             <p>This means that if you only need a package present
                   11346:             whilst you are building, it should be noted as a
1.14      xtraeme  11347:             <code class="varname">BUILD_DEPENDS</code>.</p>
1.1       grant    11348: 
1.14      xtraeme  11349:             <p>The format for a <code class=
                   11350:             "varname">BUILD_DEPENDS</code> and a <code class=
                   11351:             "varname">DEPENDS</code> definition is:</p>
1.1       grant    11352:             <pre class="programlisting">
1.51      rillig   11353:     &lt;pre-req-package-name&gt;:../../&lt;category&gt;/&lt;pre-req-package&gt;
1.1       grant    11354: </pre>
                   11355: 
                   11356:             <p>Please note that the &#8220;<span class=
                   11357:             "quote">pre-req-package-name</span>&#8221; may include
1.18      xtraeme  11358:             any of the wildcard version numbers recognized by
1.1       grant    11359:             <a href=
                   11360:             "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_info+1+NetBSD-current">
                   11361:             <span class="citerefentry"><span class=
                   11362:             "refentrytitle">pkg_info</span>(1)</span></a>.</p>
                   11363: 
                   11364:             <div class="orderedlist">
                   11365:               <ol type="1">
                   11366:                 <li>
                   11367:                   <p>If your package needs another package's
                   11368:                   binaries or libraries to build or run, and if
1.45      wiz      11369:                   that package has a <code xmlns=
                   11370:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  11371:                   "filename">buildlink3.mk</code> file available,
                   11372:                   use it:</p>
1.1       grant    11373:                   <pre class="programlisting">
                   11374:     .include "../../graphics/jpeg/buildlink3.mk"
                   11375: </pre>
                   11376:                 </li>
                   11377: 
                   11378:                 <li>
                   11379:                   <p>If your package needs to use another package
1.45      wiz      11380:                   to build itself and there is no <code xmlns=
                   11381:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  11382:                   "filename">buildlink3.mk</code> file available,
                   11383:                   use the <code class=
                   11384:                   "varname">BUILD_DEPENDS</code> definition:</p>
1.1       grant    11385:                   <pre class="programlisting">
1.51      rillig   11386:     BUILD_DEPENDS+= autoconf-2.13:../../devel/autoconf
1.1       grant    11387: </pre>
                   11388:                 </li>
                   11389: 
                   11390:                 <li>
                   11391:                   <p>If your package needs a library with which to
1.45      wiz      11392:                   link and again there is no <code xmlns=
                   11393:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  11394:                   "filename">buildlink3.mk</code> file available,
                   11395:                   this is specified using the <code class=
                   11396:                   "varname">DEPENDS</code> definition. An example
                   11397:                   of this is the <a xmlns=
1.1       grant    11398:                   "http://www.w3.org/TR/xhtml1/transitional" href=
                   11399:                   "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/lyx/README.html"
1.45      wiz      11400:                   target="_top"><code xmlns="" class=
                   11401:                   "filename">print/lyx</code></a> package, which
                   11402:                   uses the xpm library, version 3.4j to build:</p>
1.1       grant    11403:                   <pre class="programlisting">
1.51      rillig   11404:     DEPENDS+=       xpm-3.4j:../../graphics/xpm
1.1       grant    11405: </pre>
                   11406: 
                   11407:                   <p>You can also use wildcards in package
                   11408:                   dependences:</p>
                   11409:                   <pre class="programlisting">
1.51      rillig   11410:     DEPENDS+=       xpm-[0-9]*:../../graphics/xpm
1.1       grant    11411: </pre>
                   11412: 
                   11413:                   <p>Note that such wildcard dependencies are
                   11414:                   retained when creating binary packages. The
                   11415:                   dependency is checked when installing the binary
                   11416:                   package and any package which matches the pattern
                   11417:                   will be used. Wildcard dependencies should be
                   11418:                   used with care.</p>
                   11419: 
                   11420:                   <p>The &#8220;<span class=
                   11421:                   "quote">-[0-9]*</span>&#8221; should be used
                   11422:                   instead of &#8220;<span class=
                   11423:                   "quote">-*</span>&#8221; to avoid potentially
                   11424:                   ambiguous matches such as &#8220;<span class=
                   11425:                   "quote">tk-postgresql</span>&#8221; matching a
                   11426:                   &#8220;<span class="quote">tk-*</span>&#8221;
1.14      xtraeme  11427:                   <code class="varname">DEPENDS</code>.</p>
1.1       grant    11428: 
                   11429:                   <p>Wildcards can also be used to specify that a
                   11430:                   package will only build against a certain minimum
                   11431:                   version of a pre-requisite:</p>
                   11432:                   <pre class="programlisting">
1.51      rillig   11433:     DEPENDS+=       tiff&gt;=3.5.4:../../graphics/tiff
1.1       grant    11434: </pre>
                   11435: 
                   11436:                   <p>This means that the package will build against
                   11437:                   version 3.5.4 of the tiff library or newer. Such
                   11438:                   a dependency may be warranted if, for example,
                   11439:                   the API of the library has changed with version
                   11440:                   3.5.4 and a package would not compile against an
                   11441:                   earlier version of tiff.</p>
                   11442: 
                   11443:                   <p>Please note that such dependencies should only
                   11444:                   be updated if a package requires a newer
                   11445:                   pre-requisite, but not to denote recommendations
                   11446:                   such as security updates or ABI changes that do
                   11447:                   not prevent a package from building correctly.
                   11448:                   Such recommendations can be expressed using
1.14      xtraeme  11449:                   <code class="varname">RECOMMENDED</code>:</p>
1.1       grant    11450:                   <pre class="programlisting">
1.51      rillig   11451:     RECOMMENDED+=   tiff&gt;=3.6.1:../../graphics/tiff
1.1       grant    11452: </pre>
                   11453: 
1.14      xtraeme  11454:                   <p>In addition to the above <code class=
                   11455:                   "varname">DEPENDS</code> line, this denotes that
1.1       grant    11456:                   while a package will build against
                   11457:                   tiff&gt;=3.5.4, at least version 3.6.1 is
1.14      xtraeme  11458:                   recommended. <code class=
                   11459:                   "varname">RECOMMENDED</code> entries will be
                   11460:                   turned into dependencies unless explicitly
                   11461:                   ignored (in which case a warning will be
1.36      wiz      11462:                   printed).</p>
                   11463: 
                   11464:                   <p>To ignore these dependency recommendations and
                   11465:                   just use the required <code class=
                   11466:                   "varname">DEPENDS</code>, set <code class=
                   11467:                   "varname">IGNORE_RECOMMENDED=YES</code>. This may
                   11468:                   make it easier and faster to update packages
                   11469:                   built using pkgsrc, since older compatible
                   11470:                   dependencies can continue to be used. This is
                   11471:                   useful for people who watch their rebuilds very
                   11472:                   carefully; it is not very good as a
                   11473:                   general-purpose hammer. If you use it, you need
                   11474:                   to be mindful of possible ABI changes, including
                   11475:                   those from the underlying OS.</p>
                   11476: 
                   11477:                   <p>Packages that are built with recommendations
                   11478:                   ignored may not be uploaded to ftp.NetBSD.org by
                   11479:                   developers and should not be used across
                   11480:                   different systems that may have different
                   11481:                   versions of binary packages installed.</p>
1.1       grant    11482: 
                   11483:                   <p>For security fixes, please update the package
                   11484:                   vulnerabilities file as well as setting
1.14      xtraeme  11485:                   <code class="varname">RECOMMENDED</code>, see
1.1       grant    11486:                   <a href="#security-handling" title=
1.38      dillo    11487:                   "15.1.8.&nbsp;Handling packages with security problems">
1.52      tv       11488:                   Section&nbsp;15.1.8, &#8220;Handling packages
                   11489:                   with security problems&#8221;</a> for more
1.1       grant    11490:                   information.</p>
                   11491:                 </li>
                   11492: 
                   11493:                 <li>
                   11494:                   <p>If your package needs some executable to be
1.17      sketch   11495:                   able to run correctly and if there's no
1.45      wiz      11496:                   <code xmlns=
                   11497:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   11498:                   "filename">buildlink3.mk</code> file, this is
                   11499:                   specified using the <code class=
1.14      xtraeme  11500:                   "varname">DEPENDS</code> variable. The <a xmlns=
1.1       grant    11501:                   "http://www.w3.org/TR/xhtml1/transitional" href=
                   11502:                   "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/lyx/README.html"
1.45      wiz      11503:                   target="_top"><code xmlns="" class=
                   11504:                   "filename">print/lyx</code></a> package needs to
                   11505:                   be able to execute the latex binary from the
                   11506:                   teTeX package when it runs, and that is
                   11507:                   specified:</p>
1.1       grant    11508:                   <pre class="programlisting">
1.51      rillig   11509:     DEPENDS+=        teTeX-[0-9]*:../../print/teTeX
1.1       grant    11510: </pre>
                   11511: 
                   11512:                   <p>The comment about wildcard dependencies from
                   11513:                   previous paragraph applies here, too.</p>
                   11514:                 </li>
                   11515:               </ol>
                   11516:             </div>
                   11517: 
                   11518:             <p>If your package needs files from another package to
                   11519:             build, see the first part of the &#8220;<span class=
                   11520:             "quote">do-configure</span>&#8221; target <a xmlns=
                   11521:             "http://www.w3.org/TR/xhtml1/transitional" href=
                   11522:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/ghostscript5/README.html"
1.45      wiz      11523:             target="_top"><code xmlns="" class=
                   11524:             "filename">print/ghostscript5</code></a> package (it
1.20      ben      11525:             relies on the jpeg sources being present in source form
                   11526:             during the build):</p>
1.1       grant    11527:             <pre class="programlisting">
1.51      rillig   11528:     if [ ! -e ${_PKGSRCDIR}/graphics/jpeg/${WRKDIR:T}/jpeg-6b ]; then    \
                   11529:         cd ${_PKGSRCDIR}/../../graphics/jpeg &amp;&amp; ${MAKE} extract; \
1.1       grant    11530:     fi
                   11531: </pre>
                   11532: 
                   11533:             <p>If you build any other packages that way, please
                   11534:             make sure the working files are deleted too when this
                   11535:             package's working files are cleaned up. The easiest way
                   11536:             to do so is by adding a pre-clean target:</p>
                   11537:             <pre class="programlisting">
1.51      rillig   11538:     pre-clean:
                   11539:             cd ${_PKGSRCDIR}/../../graphics/jpeg &amp;&amp; ${MAKE} clean
1.1       grant    11540: </pre>
                   11541: 
1.14      xtraeme  11542:             <p>Please also note the <code class=
                   11543:             "varname">BUILD_USES_MSGFMT</code> and <code class=
                   11544:             "varname">BUILD_USES_GETTEXT_M4</code> definitions,
                   11545:             which are provided as convenience definitions. The
1.24      wiz      11546:             former works out whether <a href=
                   11547:             "http://netbsd.gw.com/cgi-bin/man-cgi?msgfmt+1+NetBSD-current">
                   11548:             <span class="citerefentry"><span class=
                   11549:             "refentrytitle">msgfmt</span>(1)</span></a> is part of
                   11550:             the base system, and, if it isn't, installs the
                   11551:             <a xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   11552:             href=
1.1       grant    11553:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/gettext/README.html"
1.45      wiz      11554:             target="_top"><code xmlns="" class=
                   11555:             "filename">devel/gettext</code></a> package. The latter
1.20      ben      11556:             adds a build dependency on either an installed version
                   11557:             of an older gettext package, or if it isn't, installs
                   11558:             the <a xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   11559:             href=
                   11560:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/gettext-m4/README.html"
1.45      wiz      11561:             target="_top"><code xmlns="" class=
                   11562:             "filename">devel/gettext-m4</code></a> package.</p>
1.1       grant    11563:           </div>
                   11564: 
1.52      tv       11565:           <div class="sect2" lang="en">
1.1       grant    11566:             <div class="titlepage">
                   11567:               <div>
                   11568:                 <div>
1.52      tv       11569:                   <h3 class="title"><a name=
1.38      dillo    11570:                   "conflicts"></a>15.1.5.&nbsp;Handling conflicts
1.1       grant    11571:                   with other packages</h3>
                   11572:                 </div>
                   11573:               </div>
                   11574:             </div>
                   11575: 
                   11576:             <p>Your package may conflict with other packages a user
                   11577:             might already have installed on his system, e.g. if
                   11578:             your package installs the same set of files like
                   11579:             another package in our pkgsrc tree.</p>
                   11580: 
1.14      xtraeme  11581:             <p>In this case you can set <code class=
1.47      reed     11582:             "varname">CONFLICTS</code> to a space-separated list of
1.1       grant    11583:             packages (including version string) your package
                   11584:             conflicts with.</p>
                   11585: 
1.47      reed     11586:             <p>For example, <a xmlns=
1.1       grant    11587:             "http://www.w3.org/TR/xhtml1/transitional" href=
                   11588:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/Xaw3d/README.html"
1.45      wiz      11589:             target="_top"><code xmlns="" class=
                   11590:             "filename">x11/Xaw3d</code></a> and <a xmlns=
1.20      ben      11591:             "http://www.w3.org/TR/xhtml1/transitional" href=
                   11592:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/Xaw-Xpm/README.html"
1.45      wiz      11593:             target="_top"><code xmlns="" class=
1.47      reed     11594:             "filename">x11/Xaw-Xpm</code></a> install the same
                   11595:             shared library, thus you set in <code xmlns=
1.45      wiz      11596:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.20      ben      11597:             "filename">pkgsrc/x11/Xaw3d/Makefile</code>:</p>
1.1       grant    11598:             <pre class="programlisting">
1.51      rillig   11599:     CONFLICTS=      Xaw-Xpm-[0-9]*
1.1       grant    11600: </pre>
                   11601: 
1.45      wiz      11602:             <p>and in <code xmlns=
                   11603:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  11604:             "filename">pkgsrc/x11/Xaw-Xpm/Makefile</code>:</p>
1.1       grant    11605:             <pre class="programlisting">
1.51      rillig   11606:     CONFLICTS=      Xaw3d-[0-9]*
1.1       grant    11607: </pre>
                   11608: 
                   11609:             <p>Packages will automatically conflict with other
                   11610:             packages with the name prefix and a different version
                   11611:             string. &#8220;<span class=
                   11612:             "quote">Xaw3d-1.5</span>&#8221; e.g. will automatically
                   11613:             conflict with the older version &#8220;<span class=
                   11614:             "quote">Xaw3d-1.3</span>&#8221;.</p>
                   11615:           </div>
                   11616: 
1.52      tv       11617:           <div class="sect2" lang="en">
1.1       grant    11618:             <div class="titlepage">
                   11619:               <div>
                   11620:                 <div>
1.52      tv       11621:                   <h3 class="title"><a name=
1.38      dillo    11622:                   "not-building-packages"></a>15.1.6.&nbsp;Packages
1.30      wiz      11623:                   that cannot or should not be built</h3>
1.1       grant    11624:                 </div>
                   11625:               </div>
                   11626:             </div>
                   11627: 
                   11628:             <p>There are several reasons why a package might be
                   11629:             instructed to not build under certain circumstances. If
                   11630:             the package builds and runs on most platforms, the
1.14      xtraeme  11631:             exceptions should be noted with <code class=
                   11632:             "varname">NOT_FOR_PLATFORM</code>. If the package
                   11633:             builds and runs on a small handful of platforms, set
                   11634:             <code class="varname">ONLY_FOR_PLATFORM</code> instead.
1.45      wiz      11635:             Both <code class="varname">ONLY_FOR_PLATFORM</code> and
                   11636:             <code class="varname">NOT_FOR_PLATFORM</code> are OS
                   11637:             triples (OS-version-platform) that can use glob-style
                   11638:             wildcards.</p>
                   11639: 
                   11640:             <p>If the package should be skipped (for example,
                   11641:             because it provides functionality already provided by
                   11642:             the system), set <code class=
1.14      xtraeme  11643:             "varname">PKG_SKIP_REASON</code> to a descriptive
                   11644:             message. If the package should fail because some
                   11645:             preconditions are not met, set <code class=
                   11646:             "varname">PKG_FAIL_REASON</code> to a descriptive
1.1       grant    11647:             message.</p>
                   11648:           </div>
                   11649: 
1.52      tv       11650:           <div class="sect2" lang="en">
1.1       grant    11651:             <div class="titlepage">
                   11652:               <div>
                   11653:                 <div>
1.52      tv       11654:                   <h3 class="title"><a name=
1.38      dillo    11655:                   "undeletable-packages"></a>15.1.7.&nbsp;Packages
1.30      wiz      11656:                   which should not be deleted, once installed</h3>
1.1       grant    11657:                 </div>
                   11658:               </div>
                   11659:             </div>
                   11660: 
                   11661:             <p>To ensure that a package may not be deleted, once it
1.14      xtraeme  11662:             has been installed, the <code class=
                   11663:             "varname">PKG_PRESERVE</code> definition should be set
                   11664:             in the package Makefile. This will be carried into any
1.1       grant    11665:             binary package that is made from this pkgsrc entry. A
                   11666:             &#8220;<span class="quote">preserved</span>&#8221;
                   11667:             package will not be deleted using <a href=
                   11668:             "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1+NetBSD-current">
                   11669:             <span class="citerefentry"><span class=
                   11670:             "refentrytitle">pkg_delete</span>(1)</span></a> unless
                   11671:             the &#8220;<span class="quote">-f</span>&#8221; option
                   11672:             is used.</p>
                   11673:           </div>
                   11674: 
1.52      tv       11675:           <div class="sect2" lang="en">
1.1       grant    11676:             <div class="titlepage">
                   11677:               <div>
                   11678:                 <div>
1.52      tv       11679:                   <h3 class="title"><a name=
1.38      dillo    11680:                   "security-handling"></a>15.1.8.&nbsp;Handling
1.1       grant    11681:                   packages with security problems</h3>
                   11682:                 </div>
                   11683:               </div>
                   11684:             </div>
                   11685: 
                   11686:             <p>When a vulnerability is found, this should be noted
1.45      wiz      11687:             in <code xmlns=
                   11688:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  11689:             "filename">localsrc/security/advisories/pkg-vulnerabilities</code>,
1.43      wiz      11690:             and after committing that file, use
                   11691:             <span><strong class="command">make
                   11692:             upload</strong></span> in the same directory to update
                   11693:             the file on ftp.NetBSD.org.</p>
                   11694: 
                   11695:             <p>After fixing the vulnerability by a patch, its
                   11696:             <code class="varname">PKGREVISION</code> should be
                   11697:             increased (this is of course not necessary if the
                   11698:             problem is fixed by using a newer release of the
1.45      wiz      11699:             software). In addition, if a <code xmlns=
                   11700:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  11701:             "filename">buildlink3.mk</code> file exists for an
1.43      wiz      11702:             affected package, a corresponding <code class=
1.14      xtraeme  11703:             "varname">BUILDLINK_RECOMMENDED.<em class=
                   11704:             "replaceable"><code>pkg</code></em></code> entry should
1.43      wiz      11705:             be added or updated in it.</p>
1.1       grant    11706: 
                   11707:             <p>Also, if the fix should be applied to the stable
                   11708:             pkgsrc branch, be sure to submit a pullup request!</p>
1.43      wiz      11709: 
                   11710:             <p>Binary packages already on ftp.NetBSD.org will be
                   11711:             handled semi-automatically by a weekly cron job.</p>
1.1       grant    11712:           </div>
                   11713: 
1.52      tv       11714:           <div class="sect2" lang="en">
1.1       grant    11715:             <div class="titlepage">
                   11716:               <div>
                   11717:                 <div>
1.52      tv       11718:                   <h3 class="title"><a name=
1.38      dillo    11719:                   "compiler-bugs"></a>15.1.9.&nbsp;How to handle
1.1       grant    11720:                   compiler bugs</h3>
                   11721:                 </div>
                   11722:               </div>
                   11723:             </div>
                   11724: 
                   11725:             <p>Some source files trigger bugs in the compiler,
                   11726:             based on combinations of compiler version and
                   11727:             architecture and almost always relation to optimisation
                   11728:             being enabled. Common symptoms are gcc internal errors
                   11729:             or never finishing compiling a file.</p>
                   11730: 
1.47      reed     11731:             <p>Typically, a workaround involves testing the
1.14      xtraeme  11732:             <code class="varname">MACHINE_ARCH</code> and compiler
1.1       grant    11733:             version, disabling optimisation for that
1.14      xtraeme  11734:             file/<code class="varname">MACHINE_ARCH</code>/compiler
1.45      wiz      11735:             combination, and documenting it in <code xmlns=
                   11736:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  11737:             "filename">pkgsrc/doc/HACKS</code>. See that file for a
1.1       grant    11738:             number of examples!</p>
                   11739:           </div>
                   11740: 
1.52      tv       11741:           <div class="sect2" lang="en">
1.1       grant    11742:             <div class="titlepage">
                   11743:               <div>
                   11744:                 <div>
1.52      tv       11745:                   <h3 class="title"><a name=
                   11746:                   "bumping-pkgrevision"></a>15.1.10.&nbsp;How to
1.30      wiz      11747:                   handle incrementing versions when fixing an
                   11748:                   existing package</h3>
1.1       grant    11749:                 </div>
                   11750:               </div>
                   11751:             </div>
                   11752: 
                   11753:             <p>When making fixes to an existing package it can be
1.14      xtraeme  11754:             useful to change the version number in <code class=
                   11755:             "varname">PKGNAME</code>. To avoid conflicting with
1.1       grant    11756:             future versions by the original author, a
                   11757:             &#8220;<span class="quote">nb1</span>&#8221;,
                   11758:             &#8220;<span class="quote">nb2</span>&#8221;, ...
                   11759:             suffix can be used on package versions by setting
1.14      xtraeme  11760:             <code class="varname">PKGREVISION=1</code> (2, ...).
                   11761:             The &#8220;<span class="quote">nb</span>&#8221; is
                   11762:             treated like a &#8220;<span class=
                   11763:             "quote">.</span>&#8221; by the pkg tools. e.g.</p>
1.1       grant    11764:             <pre class="programlisting">
1.51      rillig   11765:     DISTNAME=       foo-17.42
                   11766:     PKGREVISION=    9
1.1       grant    11767: </pre>
                   11768: 
1.14      xtraeme  11769:             <p>will result in a <code class=
                   11770:             "varname">PKGNAME</code> of &#8220;<span class=
1.1       grant    11771:             "quote">foo-17.42nb9</span>&#8221;.</p>
                   11772: 
                   11773:             <p>When a new release of the package is released, the
1.14      xtraeme  11774:             <code class="varname">PKGREVISION</code> should be
1.47      reed     11775:             removed, e.g. on a new minor release of the above
1.14      xtraeme  11776:             package, things should be like:</p>
1.1       grant    11777:             <pre class="programlisting">
1.51      rillig   11778:     DISTNAME=       foo-17.43
1.1       grant    11779: </pre>
                   11780:           </div>
                   11781: 
1.52      tv       11782:           <div class="sect2" lang="en">
1.1       grant    11783:             <div class="titlepage">
                   11784:               <div>
                   11785:                 <div>
1.30      wiz      11786:                   <h3 class="title"><a name=
1.38      dillo    11787:                   "portability-of-packages"></a>15.1.11.&nbsp;Portability
1.30      wiz      11788:                   of packages</h3>
1.1       grant    11789:                 </div>
                   11790:               </div>
                   11791:             </div>
                   11792: 
                   11793:             <p>One appealing feature of pkgsrc is that it runs on
                   11794:             many different platforms. As a result, it is important
                   11795:             to ensure, where possible, that packages in pkgsrc are
                   11796:             portable. There are some particular details you should
                   11797:             pay attention to while working on pkgsrc.</p>
                   11798: 
1.52      tv       11799:             <div class="sect3" lang="en">
1.1       grant    11800:               <div class="titlepage">
                   11801:                 <div>
                   11802:                   <div>
1.52      tv       11803:                     <h4 class="title"><a name=
1.38      dillo    11804:                     "install-scripts"></a>15.1.11.1.&nbsp;${INSTALL},
1.1       grant    11805:                     ${INSTALL_DATA_DIR}, ...</h4>
                   11806:                   </div>
                   11807:                 </div>
                   11808:               </div>
                   11809: 
1.14      xtraeme  11810:               <p>The BSD-compatible <span><strong class=
                   11811:               "command">install</strong></span> supplied with some
1.1       grant    11812:               operating systems will not perform more than one
                   11813:               operation at a time. As such, you should call
                   11814:               &#8220;<span class="quote">${INSTALL}</span>&#8221;,
                   11815:               etc. like this:</p>
                   11816:               <pre class="programlisting">
1.51      rillig   11817:     ${INSTALL_DATA_DIR} ${PREFIX}/dir1
                   11818:     ${INSTALL_DATA_DIR} ${PREFIX}/dir2
1.1       grant    11819: </pre>
                   11820:             </div>
                   11821:           </div>
                   11822:         </div>
                   11823: 
1.52      tv       11824:         <div class="sect1" lang="en">
1.1       grant    11825:           <div class="titlepage">
                   11826:             <div>
                   11827:               <div>
                   11828:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    11829:                 "downloading-issues"></a>15.2.&nbsp;Possible
1.1       grant    11830:                 downloading issues</h2>
                   11831:               </div>
                   11832:             </div>
                   11833:           </div>
                   11834: 
1.52      tv       11835:           <div class="sect2" lang="en">
1.1       grant    11836:             <div class="titlepage">
                   11837:               <div>
                   11838:                 <div>
1.52      tv       11839:                   <h3 class="title"><a name=
1.38      dillo    11840:                   "no-plain-download"></a>15.2.1.&nbsp;Packages
1.30      wiz      11841:                   whose distfiles aren't available for plain
1.1       grant    11842:                   downloading</h3>
                   11843:                 </div>
                   11844:               </div>
                   11845:             </div>
                   11846: 
                   11847:             <p>If you need to download from a dynamic URL you can
1.14      xtraeme  11848:             set <code class="varname">DYNAMIC_MASTER_SITES</code>
                   11849:             and a <span><strong class="command">make
1.45      wiz      11850:             fetch</strong></span> will call <code xmlns=
                   11851:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  11852:             "filename">files/getsite.sh</code> with the name of
                   11853:             each file to download as an argument, expecting it to
                   11854:             output the URL of the directory from which to download
                   11855:             it. <a xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   11856:             href=
1.1       grant    11857:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/graphics/ns-cult3d/README.html"
1.45      wiz      11858:             target="_top"><code xmlns="" class=
                   11859:             "filename">graphics/ns-cult3d</code></a> is an example
                   11860:             of this usage.</p>
1.1       grant    11861: 
                   11862:             <p>If the download can't be automated, because the user
                   11863:             must submit personal information to apply for a
                   11864:             password, or must pay for the source, or whatever, you
1.14      xtraeme  11865:             can set <code class="varname">_FETCH_MESSAGE</code> to
                   11866:             a macro which displays a message explaining the
                   11867:             situation. <code class="varname">_FETCH_MESSAGE</code>
                   11868:             must be executable shell commands, not just a message.
                   11869:             (Generally, it executes <code class=
                   11870:             "varname">${ECHO}</code>). As of this writing, the
1.1       grant    11871:             following packages use this: <a xmlns=
                   11872:             "http://www.w3.org/TR/xhtml1/transitional" href=
1.20      ben      11873:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/cad/simian/README.html"
1.45      wiz      11874:             target="_top"><code xmlns="" class=
                   11875:             "filename">cad/simian</code></a>, <a xmlns=
1.20      ben      11876:             "http://www.w3.org/TR/xhtml1/transitional" href=
                   11877:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/ipv6socket/README.html"
1.45      wiz      11878:             target="_top"><code xmlns="" class=
                   11879:             "filename">devel/ipv6socket</code></a>, <a xmlns=
1.20      ben      11880:             "http://www.w3.org/TR/xhtml1/transitional" href=
                   11881:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/emulators/vmware-module/README.html"
1.45      wiz      11882:             target="_top"><code xmlns="" class=
                   11883:             "filename">emulators/vmware-module</code></a>,
                   11884:             <a xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   11885:             href=
1.20      ben      11886:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/fonts/acroread-jpnfont/README.html"
1.45      wiz      11887:             target="_top"><code xmlns="" class=
                   11888:             "filename">fonts/acroread-jpnfont</code></a>, <a xmlns=
1.20      ben      11889:             "http://www.w3.org/TR/xhtml1/transitional" href=
1.43      wiz      11890:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/multimedia/realplayer/README.html"
1.45      wiz      11891:             target="_top"><code xmlns="" class=
                   11892:             "filename">multimedia/realplayer</code></a>, <a xmlns=
1.43      wiz      11893:             "http://www.w3.org/TR/xhtml1/transitional" href=
1.20      ben      11894:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/sysutils/storage-manager/README.html"
1.45      wiz      11895:             target="_top"><code xmlns="" class=
                   11896:             "filename">sysutils/storage-manager</code></a>,
                   11897:             <a xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   11898:             href=
1.20      ben      11899:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/ap-aolserver/README.html"
1.45      wiz      11900:             target="_top"><code xmlns="" class=
                   11901:             "filename">www/ap-aolserver</code></a>, <a xmlns=
1.20      ben      11902:             "http://www.w3.org/TR/xhtml1/transitional" href=
                   11903:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/openacs/README.html"
1.45      wiz      11904:             target="_top"><code xmlns="" class=
                   11905:             "filename">www/openacs</code></a>. Try to be consistent
1.20      ben      11906:             with them.</p>
1.1       grant    11907:           </div>
                   11908: 
1.52      tv       11909:           <div class="sect2" lang="en">
1.1       grant    11910:             <div class="titlepage">
                   11911:               <div>
                   11912:                 <div>
1.30      wiz      11913:                   <h3 class="title"><a name=
1.38      dillo    11914:                   "modified-distfiles-same-name"></a>15.2.2.&nbsp;How
1.30      wiz      11915:                   to handle modified distfiles with the 'old'
                   11916:                   name</h3>
1.1       grant    11917:                 </div>
                   11918:               </div>
                   11919:             </div>
                   11920: 
                   11921:             <p>Sometimes authors of a software package make some
                   11922:             modifications after the software was released, and they
                   11923:             put up a new distfile without changing the package's
                   11924:             version number. If a package is already in pkgsrc at
1.32      wiz      11925:             that time, the checksum will no longer match. The
                   11926:             contents of the new distfile should be compared against
                   11927:             the old one before changing anything, to make sure the
                   11928:             distfile was really updated on purpose, and that no
                   11929:             trojan horse or so crept in. Then, the correct way to
                   11930:             work around this is to set <code class=
                   11931:             "varname">DIST_SUBDIR</code> to a unique directory
                   11932:             name, usually based on <code class=
                   11933:             "varname">PKGNAME_NOREV</code>. In case this happens
                   11934:             more often, <code class="varname">PKGNAME</code> can be
1.45      wiz      11935:             used (thus including the <code xmlns=
                   11936:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.32      wiz      11937:             "filename">nbX</code> suffix) or a date stamp can be
                   11938:             appended, like <code class=
                   11939:             "varname">${PKGNAME_NOREV}-YYYYMMDD</code>. Do not
1.45      wiz      11940:             forget regenerating the <code xmlns=
                   11941:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.32      wiz      11942:             "filename">distinfo</code> file after that, since it
                   11943:             contains the <code class="varname">DIST_SUBDIR</code>
                   11944:             path in the filenames. Furthermore, a mail to the
                   11945:             package's authors seems appropriate telling them that
                   11946:             changing distfiles after releases without changing the
                   11947:             file names is not good practice.</p>
1.1       grant    11948:           </div>
                   11949:         </div>
                   11950: 
1.52      tv       11951:         <div class="sect1" lang="en">
1.1       grant    11952:           <div class="titlepage">
                   11953:             <div>
                   11954:               <div>
                   11955:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    11956:                 "configuration-gotchas"></a>15.3.&nbsp;Configuration
1.1       grant    11957:                 gotchas</h2>
                   11958:               </div>
                   11959:             </div>
                   11960:           </div>
                   11961: 
1.52      tv       11962:           <div class="sect2" lang="en">
1.1       grant    11963:             <div class="titlepage">
                   11964:               <div>
                   11965:                 <div>
1.52      tv       11966:                   <h3 class="title"><a name=
1.38      dillo    11967:                   "fixes.libtool"></a>15.3.1.&nbsp;Shared libraries
1.1       grant    11968:                   - libtool</h3>
                   11969:                 </div>
                   11970:               </div>
                   11971:             </div>
                   11972: 
                   11973:             <p>pkgsrc supports many different machines, with
                   11974:             different object formats like a.out and ELF, and
                   11975:             varying abilities to do shared library and dynamic
                   11976:             loading at all. To accompany this, varying commands and
                   11977:             options have to be passed to the compiler, linker, etc.
                   11978:             to get the Right Thing, which can be pretty annoying
                   11979:             especially if you don't have all the machines at your
                   11980:             hand to test things. The <a xmlns=
                   11981:             "http://www.w3.org/TR/xhtml1/transitional" href=
                   11982:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/libtool/README.html"
1.45      wiz      11983:             target="_top"><code xmlns="" class=
                   11984:             "filename">devel/libtool</code></a> pkg can help here,
                   11985:             as it just &#8220;<span class=
                   11986:             "quote">knows</span>&#8221; how to build both static
                   11987:             and dynamic libraries from a set of source files, thus
1.47      reed     11988:             being platform-independent.</p>
1.1       grant    11989: 
                   11990:             <p>Here's how to use libtool in a pkg in seven simple
                   11991:             steps:</p>
                   11992: 
                   11993:             <div class="orderedlist">
                   11994:               <ol type="1">
                   11995:                 <li>
1.14      xtraeme  11996:                   <p>Add <code class=
                   11997:                   "varname">USE_LIBTOOL=yes</code> to the package
                   11998:                   Makefile.</p>
1.1       grant    11999:                 </li>
                   12000: 
                   12001:                 <li>
                   12002:                   <p>For library objects, use &#8220;<span class=
                   12003:                   "quote">${LIBTOOL} --mode=compile
                   12004:                   ${CC}</span>&#8221; in place of
                   12005:                   &#8220;<span class="quote">${CC}</span>&#8221;.
                   12006:                   You could even add it to the definition of
1.14      xtraeme  12007:                   <code class="varname">CC</code>, if only
                   12008:                   libraries are being built in a given Makefile.
                   12009:                   This one command will build both PIC and non-PIC
                   12010:                   library objects, so you need not have separate
                   12011:                   shared and non-shared library rules.</p>
1.1       grant    12012:                 </li>
                   12013: 
                   12014:                 <li>
                   12015:                   <p>For the linking of the library, remove any
                   12016:                   &#8220;<span class="quote">ar</span>&#8221;,
                   12017:                   &#8220;<span class="quote">ranlib</span>&#8221;,
                   12018:                   and &#8220;<span class="quote">ld
                   12019:                   -Bshareable</span>&#8221; commands, and instead
                   12020:                   use:</p>
                   12021:                   <pre class="programlisting">
1.51      rillig   12022:     ${LIBTOOL} --mode=link ${CC} -o ${.TARGET:.a=.la} ${OBJS:.o=.lo} \
                   12023:         -rpath ${PREFIX}/lib -version-info major:minor
1.1       grant    12024: </pre>
                   12025: 
                   12026:                   <p>Note that the library is changed to have a
1.45      wiz      12027:                   <code xmlns=
                   12028:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   12029:                   "filename">.la</code> extension, and the objects
                   12030:                   are changed to have a <code xmlns=
                   12031:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12032:                   "filename">.lo</code> extension. Change
                   12033:                   <code class="varname">OBJS</code> as necessary.
                   12034:                   This automatically creates all of the
1.45      wiz      12035:                   <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   12036:                   class="filename">.a</code>, <code xmlns=
                   12037:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12038:                   "filename">.so.major.minor</code>, and ELF
                   12039:                   symlinks (if necessary) in the build directory.
                   12040:                   Be sure to include &#8220;<span class=
1.1       grant    12041:                   "quote">-version-info</span>&#8221;, especially
                   12042:                   when major and minor are zero, as libtool will
                   12043:                   otherwise strip off the shared library
                   12044:                   version.</p>
                   12045: 
                   12046:                   <p>From the libtool manual:</p>
                   12047:                   <pre class="programlisting">
1.51      rillig   12048:     So, libtool library versions are described by three integers:
1.1       grant    12049: 
1.51      rillig   12050:     CURRENT
                   12051:         The most recent interface number that this library implements.
1.1       grant    12052: 
1.51      rillig   12053:     REVISION
                   12054:         The implementation number of the CURRENT interface.
1.1       grant    12055: 
1.51      rillig   12056:     AGE
                   12057:         The difference between the newest and oldest interfaces that
                   12058:         this library implements.  In other words, the library implements
                   12059:         all the interface numbers in the range from number `CURRENT -
                   12060:         AGE' to `CURRENT'.
1.1       grant    12061:        
1.51      rillig   12062:     If two libraries have identical CURRENT and AGE numbers, then the
                   12063:     dynamic linker chooses the library with the greater REVISION number.
1.1       grant    12064: </pre>
                   12065: 
                   12066:                   <p>The &#8220;<span class=
                   12067:                   "quote">-release</span>&#8221; option will
                   12068:                   produce different results for a.out and ELF
                   12069:                   (excluding symlinks) in only one case. An ELF
                   12070:                   library of the form &#8220;<span class=
                   12071:                   "quote">libfoo-release.so.<span class=
                   12072:                   "emphasis"><em>x</em></span>.<span class=
                   12073:                   "emphasis"><em>y</em></span></span>&#8221; will
                   12074:                   have a symlink of &#8220;<span class=
                   12075:                   "quote">libfoo.so.<span class=
                   12076:                   "emphasis"><em>x</em></span>.<span class=
                   12077:                   "emphasis"><em>y</em></span></span>&#8221; on an
                   12078:                   a.out platform. This is handled
                   12079:                   automatically.</p>
                   12080: 
                   12081:                   <p>The &#8220;<span class="quote">-rpath
                   12082:                   argument</span>&#8221; is the install directory
                   12083:                   of the library being built.</p>
                   12084: 
1.45      wiz      12085:                   <p>In the <code xmlns=
                   12086:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   12087:                   "filename">PLIST</code>, include only the
                   12088:                   <code xmlns=
                   12089:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.19      hubertf  12090:                   "filename">.la</code> file, the other files will
                   12091:                   be added automatically.</p>
1.1       grant    12092:                 </li>
                   12093: 
                   12094:                 <li>
1.45      wiz      12095:                   <p>When linking shared object (<code xmlns=
                   12096:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12097:                   "filename">.so</code>) files, i.e. files that are
1.24      wiz      12098:                   loaded via <a href=
                   12099:                   "http://netbsd.gw.com/cgi-bin/man-cgi?dlopen+3+NetBSD-current">
                   12100:                   <span class="citerefentry"><span class=
                   12101:                   "refentrytitle">dlopen</span>(3)</span></a>, NOT
                   12102:                   shared libraries, use &#8220;<span class=
                   12103:                   "quote">-module -avoid-version</span>&#8221; to
                   12104:                   prevent them getting version tacked on.</p>
1.1       grant    12105: 
1.45      wiz      12106:                   <p>The <code xmlns=
                   12107:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   12108:                   "filename">PLIST</code> file gets the
                   12109:                   <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   12110:                   class="filename">foo.so</code> entry.</p>
1.1       grant    12111:                 </li>
                   12112: 
                   12113:                 <li>
                   12114:                   <p>When linking programs that depend on these
                   12115:                   libraries <span class=
                   12116:                   "emphasis"><em>before</em></span> they are
                   12117:                   installed, preface the <a href=
                   12118:                   "http://netbsd.gw.com/cgi-bin/man-cgi?cc+1+NetBSD-current">
                   12119:                   <span class="citerefentry"><span class=
                   12120:                   "refentrytitle">cc</span>(1)</span></a> or
                   12121:                   <a href=
                   12122:                   "http://netbsd.gw.com/cgi-bin/man-cgi?ld+1+NetBSD-current">
                   12123:                   <span class="citerefentry"><span class=
                   12124:                   "refentrytitle">ld</span>(1)</span></a> line with
                   12125:                   &#8220;<span class="quote">${LIBTOOL}
                   12126:                   --mode=link</span>&#8221;, and it will find the
                   12127:                   correct libraries (static or shared), but please
                   12128:                   be aware that libtool will not allow you to
                   12129:                   specify a relative path in -L (such as
                   12130:                   &#8220;<span class=
                   12131:                   "quote">-L../somelib</span>&#8221;), because it
                   12132:                   expects you to change that argument to be the
1.45      wiz      12133:                   <code xmlns=
                   12134:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   12135:                   "filename">.la</code> file. e.g.</p>
1.1       grant    12136:                   <pre class="programlisting">
1.51      rillig   12137:     ${LIBTOOL} --mode=link ${CC} -o someprog -L../somelib -lsomelib
1.1       grant    12138: </pre>
                   12139: 
                   12140:                   <p>should be changed to:</p>
                   12141:                   <pre class="programlisting">
1.51      rillig   12142:     ${LIBTOOL} --mode=link ${CC} -o <em class=
1.14      xtraeme  12143: "replaceable"><code>someprog</code></em> <em class=
                   12144: "replaceable"><code>../somelib/somelib.la</code></em>
1.1       grant    12145: </pre>
                   12146: 
                   12147:                   <p>and it will do the right thing with the
                   12148:                   libraries.</p>
                   12149:                 </li>
                   12150: 
                   12151:                 <li>
                   12152:                   <p>When installing libraries, preface the
                   12153:                   <a href="http://netbsd.gw.com/cgi-bin/man-cgi?install+1+NetBSD-current">
                   12154:                   <span class="citerefentry"><span class=
                   12155:                   "refentrytitle">install</span>(1)</span></a> or
                   12156:                   <a href=
                   12157:                   "http://netbsd.gw.com/cgi-bin/man-cgi?cp+1+NetBSD-current">
                   12158:                   <span class="citerefentry"><span class=
                   12159:                   "refentrytitle">cp</span>(1)</span></a> command
                   12160:                   with &#8220;<span class="quote">${LIBTOOL}
                   12161:                   --mode=install</span>&#8221;, and change the
1.45      wiz      12162:                   library name to <code xmlns=
                   12163:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12164:                   "filename">.la</code>. e.g.</p>
1.1       grant    12165:                   <pre class="programlisting">
1.51      rillig   12166:     ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib
1.1       grant    12167: </pre>
                   12168: 
1.45      wiz      12169:                   <p>This will install the static <code xmlns=
                   12170:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12171:                   "filename">.a</code>, shared library, any needed
1.1       grant    12172:                   symlinks, and run <a href=
                   12173:                   "http://netbsd.gw.com/cgi-bin/man-cgi?ldconfig+8+NetBSD-current">
                   12174:                   <span class="citerefentry"><span class=
                   12175:                   "refentrytitle">ldconfig</span>(8)</span></a>.</p>
                   12176:                 </li>
                   12177: 
                   12178:                 <li>
1.45      wiz      12179:                   <p>In your <code xmlns=
                   12180:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   12181:                   "filename">PLIST</code>, include only the
                   12182:                   <code xmlns=
                   12183:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.23      wiz      12184:                   "filename">.la</code> file (this is a change from
                   12185:                   previous behaviour).</p>
1.1       grant    12186:                 </li>
                   12187:               </ol>
                   12188:             </div>
                   12189:           </div>
                   12190: 
1.52      tv       12191:           <div class="sect2" lang="en">
1.1       grant    12192:             <div class="titlepage">
                   12193:               <div>
                   12194:                 <div>
1.52      tv       12195:                   <h3 class="title"><a name=
1.38      dillo    12196:                   "using-libtool"></a>15.3.2.&nbsp;Using libtool on
1.30      wiz      12197:                   GNU packages that already support libtool</h3>
1.1       grant    12198:                 </div>
                   12199:               </div>
                   12200:             </div>
                   12201: 
1.14      xtraeme  12202:             <p>Add <code class="varname">USE_LIBTOOL=yes</code> to
                   12203:             the package Makefile. This will override the package's
                   12204:             own libtool in most cases. For older libtool using
1.1       grant    12205:             packages, libtool is made by ltconfig script during the
                   12206:             do-configure step; you can check the libtool script
1.14      xtraeme  12207:             location by doing <span><strong class="command">make
                   12208:             configure; find work*/ -name
                   12209:             libtool</strong></span>.</p>
                   12210: 
                   12211:             <p><code class="varname">LIBTOOL_OVERRIDE</code>
                   12212:             specifies which libtool scripts, relative to
                   12213:             <code class="varname">WRKSRC</code>, to override. By
                   12214:             default, it is set to &#8220;<span class=
                   12215:             "quote">libtool */libtool */*/libtool</span>&#8221;. If
                   12216:             this does not match the location of the package's
                   12217:             libtool script(s), set it as appropriate.</p>
1.13      hubertf  12218: 
1.45      wiz      12219:             <p>If you do not need <code xmlns=
                   12220:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   12221:             "filename">*.a</code> static libraries built and
                   12222:             installed, then use <code class=
                   12223:             "varname">SHLIBTOOL_OVERRIDE</code> instead.</p>
1.1       grant    12224: 
1.47      reed     12225:             <p>If your package makes use of the
                   12226:             platform-independent library for loading dynamic shared
                   12227:             objects, that comes with libtool (libltdl), you should
                   12228:             include devel/libltdl/buildlink3.mk.</p>
1.1       grant    12229: 
                   12230:             <p>Some packages use libtool incorrectly so that the
                   12231:             package may not work or build in some circumstances.
                   12232:             Some of the more common errors are:</p>
                   12233: 
                   12234:             <div class="itemizedlist">
                   12235:               <ul type="disc">
                   12236:                 <li>
                   12237:                   <p>The inclusion of a shared object (-module) as
                   12238:                   a dependent library in an executable or library.
                   12239:                   This in itself isn't a problem if one of two
                   12240:                   things has been done:</p>
                   12241: 
                   12242:                   <div class="orderedlist">
                   12243:                     <ol type="1">
                   12244:                       <li>
                   12245:                         <p>The shared object is named correctly,
1.45      wiz      12246:                         i.e. <code xmlns=
                   12247:                         "http://www.w3.org/TR/xhtml1/transitional"
                   12248:                         class="filename">libfoo.la</code>, not
                   12249:                         <code xmlns=
                   12250:                         "http://www.w3.org/TR/xhtml1/transitional"
                   12251:                         class="filename">foo.la</code></p>
1.1       grant    12252:                       </li>
                   12253: 
                   12254:                       <li>
                   12255:                         <p>The -dlopen option is used when linking
                   12256:                         an executable.</p>
                   12257:                       </li>
                   12258:                     </ol>
                   12259:                   </div>
                   12260:                 </li>
                   12261: 
                   12262:                 <li>
                   12263:                   <p>The use of libltdl without the correct calls
                   12264:                   to initialisation routines. The function
                   12265:                   lt_dlinit() should be called and the macro
1.14      xtraeme  12266:                   <code class=
                   12267:                   "varname">LTDL_SET_PRELOADED_SYMBOLS</code>
1.1       grant    12268:                   included in executables.</p>
                   12269:                 </li>
                   12270:               </ul>
                   12271:             </div>
                   12272:           </div>
                   12273: 
1.52      tv       12274:           <div class="sect2" lang="en">
1.1       grant    12275:             <div class="titlepage">
                   12276:               <div>
                   12277:                 <div>
1.52      tv       12278:                   <h3 class="title"><a name=
1.38      dillo    12279:                   "autoconf-automake"></a>15.3.3.&nbsp;GNU
1.1       grant    12280:                   Autoconf/Automake</h3>
                   12281:                 </div>
                   12282:               </div>
                   12283:             </div>
                   12284: 
                   12285:             <p>If a package needs GNU autoconf or automake to be
                   12286:             executed to regenerate the configure script and
                   12287:             Makefile.in makefile templates, then they should be
1.35      jmmv     12288:             executed in a pre-configure target.</p>
1.1       grant    12289: 
                   12290:             <p>For packages that need only autoconf:</p>
                   12291:             <pre class="programlisting">
1.51      rillig   12292:     AUTOCONF_REQD=  2.50            # if default version is not good enough
                   12293:     USE_TOOLS+=     autoconf        # use "autoconf213" for autoconf-2.13
                   12294:     ...
1.1       grant    12295: 
1.51      rillig   12296:     pre-configure:
                   12297:             cd ${WRKSRC}; autoconf
1.1       grant    12298: 
1.51      rillig   12299:     ...
1.1       grant    12300: </pre>
                   12301: 
                   12302:             <p>and for packages that need automake and
                   12303:             autoconf:</p>
                   12304:             <pre class="programlisting">
1.51      rillig   12305:     AUTOMAKE_REQD=  1.7.1           # if default version is not good enough
                   12306:     USE_TOOLS+=     automake        # use "automake14" for automake-1.4
                   12307:     ...
1.1       grant    12308: 
1.51      rillig   12309:     pre-configure:
                   12310:             cd ${WRKSRC};                          \
                   12311:             aclocal; autoheader;                   \
                   12312:             automake -a --foreign -i; autoconf
                   12313: 
                   12314:     ...
1.1       grant    12315: </pre>
                   12316: 
                   12317:             <p>Packages which use GNU Automake will almost
1.35      jmmv     12318:             certainly require GNU Make.</p>
1.1       grant    12319: 
                   12320:             <p>There are times when the configure process makes
                   12321:             additional changes to the generated files, which then
                   12322:             causes the build process to try to re-execute the
                   12323:             automake sequence. This is prevented by touching
                   12324:             various files in the configure stage. If this causes
1.14      xtraeme  12325:             problems with your package you can set <code class=
                   12326:             "varname">AUTOMAKE_OVERRIDE=NO</code> in the package
1.1       grant    12327:             Makefile.</p>
                   12328:           </div>
                   12329:         </div>
                   12330: 
1.52      tv       12331:         <div class="sect1" lang="en">
1.1       grant    12332:           <div class="titlepage">
                   12333:             <div>
                   12334:               <div>
                   12335:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    12336:                 "building-considerations"></a>15.4.&nbsp;Building
1.1       grant    12337:                 considerations</h2>
                   12338:               </div>
                   12339:             </div>
                   12340:           </div>
                   12341: 
1.52      tv       12342:           <div class="sect2" lang="en">
1.1       grant    12343:             <div class="titlepage">
                   12344:               <div>
                   12345:                 <div>
1.52      tv       12346:                   <h3 class="title"><a name=
1.38      dillo    12347:                   "cpp-defines"></a>15.4.1.&nbsp;CPP defines</h3>
1.1       grant    12348:                 </div>
                   12349:               </div>
                   12350:             </div>
                   12351: 
                   12352:             <p>To port an application to NetBSD, it's usually
                   12353:             necessary for the compiler to be able to judge the
                   12354:             system on which it's compiling, and we use definitions
                   12355:             so that the C pre-processor can do this.</p>
                   12356: 
                   12357:             <p>To test whether you are working on a 4.4 BSD-derived
                   12358:             system, you should use the BSD definition, which is
1.45      wiz      12359:             defined in <code xmlns=
                   12360:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12361:             "filename">&lt;sys/param.h&gt;</code> on said
1.1       grant    12362:             systems.</p>
                   12363:             <pre class="programlisting">
1.51      rillig   12364:     #include &lt;sys/param.h&gt;
1.1       grant    12365: </pre>
                   12366: 
                   12367:             <p>and then you can surround the BSD-specific parts of
                   12368:             your package's C/C++ code using this conditional:</p>
                   12369:             <pre class="programlisting">
1.51      rillig   12370:     #if (defined(BSD) &amp;&amp; BSD &gt;= 199306)
1.1       grant    12371:     ...
1.51      rillig   12372:     #endif
1.1       grant    12373: </pre>
                   12374: 
                   12375:             <p>Please use the &#8220;<span class=
                   12376:             "quote">__NetBSD__</span>&#8221; definition sparingly -
                   12377:             it should only apply to features of NetBSD that are not
1.47      reed     12378:             present in other 4.4-lite-derived BSDs.</p>
1.1       grant    12379:           </div>
1.51      rillig   12380: 
1.52      tv       12381:           <div class="sect2" lang="en">
1.51      rillig   12382:             <div class="titlepage">
                   12383:               <div>
                   12384:                 <div>
1.52      tv       12385:                   <h3 class="title"><a name=
1.51      rillig   12386:                   "cpp-list"></a>15.4.2.&nbsp;Getting a list of CPP
                   12387:                   defines</h3>
                   12388:                 </div>
                   12389:               </div>
                   12390:             </div>
                   12391: 
                   12392:             <p>When your system uses the GNU C Compiler, you can
                   12393:             get a list of symbols that are defined by default, e.g.
                   12394:             to identify the platform, with the following
                   12395:             command:</p>
                   12396:             <pre class="programlisting">
                   12397:     gcc -E -dM - &lt; /dev/null 
                   12398: </pre>
                   12399:           </div>
1.1       grant    12400:         </div>
                   12401: 
1.52      tv       12402:         <div class="sect1" lang="en">
1.1       grant    12403:           <div class="titlepage">
                   12404:             <div>
                   12405:               <div>
                   12406:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    12407:                 "package-specific-actions"></a>15.5.&nbsp;Package
1.1       grant    12408:                 specific actions</h2>
                   12409:               </div>
                   12410:             </div>
                   12411:           </div>
                   12412: 
1.52      tv       12413:           <div class="sect2" lang="en">
1.1       grant    12414:             <div class="titlepage">
                   12415:               <div>
                   12416:                 <div>
1.52      tv       12417:                   <h3 class="title"><a name=
1.38      dillo    12418:                   "user-interaction"></a>15.5.1.&nbsp;User
1.2       hubertf  12419:                   interaction</h3>
1.1       grant    12420:                 </div>
                   12421:               </div>
                   12422:             </div>
                   12423: 
                   12424:             <p>Occasionally, packages require interaction from the
                   12425:             user, and this can be in a number of ways:</p>
                   12426: 
                   12427:             <div class="itemizedlist">
                   12428:               <ul type="disc">
                   12429:                 <li>
                   12430:                   <p>help in fetching the distfiles</p>
                   12431:                 </li>
                   12432: 
                   12433:                 <li>
                   12434:                   <p>help to configure the package before it is
                   12435:                   built</p>
                   12436:                 </li>
                   12437: 
                   12438:                 <li>
                   12439:                   <p>help during the build process</p>
                   12440:                 </li>
                   12441: 
                   12442:                 <li>
                   12443:                   <p>help during the installation of a package</p>
                   12444:                 </li>
                   12445:               </ul>
                   12446:             </div>
                   12447: 
1.14      xtraeme  12448:             <p>The <code class="varname">INTERACTIVE_STAGE</code>
1.1       grant    12449:             definition is provided to notify the pkgsrc mechanism
                   12450:             of an interactive stage which will be needed, and this
1.45      wiz      12451:             should be set in the package's <code xmlns=
                   12452:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.47      reed     12453:             "filename">Makefile</code>, e.g.:</p>
1.1       grant    12454:             <pre class="programlisting">
1.51      rillig   12455:     INTERACTIVE_STAGE=      build
1.1       grant    12456: </pre>
                   12457: 
                   12458:             <p>Multiple interactive stages can be specified:</p>
                   12459:             <pre class="programlisting">
1.51      rillig   12460:     INTERACTIVE_STAGE=      configure install
1.1       grant    12461: </pre>
                   12462:           </div>
                   12463: 
1.52      tv       12464:           <div class="sect2" lang="en">
1.1       grant    12465:             <div class="titlepage">
                   12466:               <div>
                   12467:                 <div>
1.52      tv       12468:                   <h3 class="title"><a name=
1.38      dillo    12469:                   "handling-licenses"></a>15.5.2.&nbsp;Handling
1.1       grant    12470:                   licenses</h3>
                   12471:                 </div>
                   12472:               </div>
                   12473:             </div>
                   12474: 
1.44      gdt      12475:             <p>A package may be covered by a license which the user
                   12476:             has or has not agreed to accept. For these cases,
                   12477:             pkgsrc contains a mechanism to note that a package is
                   12478:             covered by a particular license, and the package cannot
                   12479:             be built unless the user has accepted the license.
                   12480:             (Installation of binary packages are not currently
                   12481:             subject to this mechanism.) Packages with licenses that
                   12482:             are either Open Source according to the Open Source
                   12483:             Initiative or Free according to the Free Software
                   12484:             Foundation will not be marked with a license tag.
                   12485:             Packages with licenses that have not been determined to
                   12486:             meet either definition will be marked with a license
                   12487:             tag referring to the license. This will prevent
                   12488:             building unless pkgsrc is informed that the license is
                   12489:             acceptable, and enables displaying the license.</p>
                   12490: 
                   12491:             <p>The license tag mechanism is intended to address
                   12492:             copyright-related issues surrounding building,
                   12493:             installing and using a package, and not to address
                   12494:             redistribution issues (see <code class=
                   12495:             "varname">RESTRICTED</code> and <code class=
                   12496:             "varname">NO_SRC_ON_FTP</code>, etc.). However, the
                   12497:             above definition of licenses for which tags are not
                   12498:             needed implies that packages with redistribution
                   12499:             restrictions should have tags.</p>
                   12500: 
                   12501:             <p>Denoting that a package is covered by a particular
1.45      wiz      12502:             license is done by placing the license in <code xmlns=
                   12503:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.44      gdt      12504:             "filename">pkgsrc/licenses</code> and setting the
                   12505:             <code class="varname">LICENSE</code> variable to a
                   12506:             string identifying the license, e.g. in <a xmlns=
1.14      xtraeme  12507:             "http://www.w3.org/TR/xhtml1/transitional" href=
1.44      gdt      12508:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/graphics/xv/README.html"
1.45      wiz      12509:             target="_top"><code xmlns="" class=
                   12510:             "filename">graphics/xv</code></a>:</p>
1.1       grant    12511:             <pre class="programlisting">
1.51      rillig   12512:     LICENSE=        xv-license
1.1       grant    12513: </pre>
                   12514: 
                   12515:             <p>When trying to build, the user will get a notice
1.44      gdt      12516:             that the package is covered by a license which has not
                   12517:             been accepted:</p>
1.1       grant    12518:             <pre class="programlisting">
1.51      rillig   12519:     <code class="prompt">%</code> <strong class=
1.14      xtraeme  12520: "userinput"><code>make</code></strong>
1.51      rillig   12521:     ===&gt; xv-3.10anb9 has an unacceptable license: xv-license.
                   12522:     ===&gt;     To view the license, enter "/usr/bin/make show-license".
                   12523:     ===&gt;     To indicate acceptance, add this line to your /etc/mk.conf:
                   12524:     ===&gt;     ACCEPTABLE_LICENSES+=xv-license
                   12525:     *** Error code 1
1.1       grant    12526: </pre>
                   12527: 
1.14      xtraeme  12528:             <p>The license can be viewed with <span><strong class=
                   12529:             "command">make show-license</strong></span>, and if it
                   12530:             is considered appropriate, the line printed above can
1.45      wiz      12531:             be added to <code xmlns=
                   12532:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   12533:             "filename">/etc/mk.conf</code> to indicate acceptance
                   12534:             of the particular license:</p>
1.1       grant    12535:             <pre class="programlisting">
1.51      rillig   12536:     ACCEPTABLE_LICENSES+=xv-license
1.1       grant    12537: </pre>
                   12538: 
                   12539:             <p>When adding a package with a new license, the
1.45      wiz      12540:             license text should be added to <code xmlns=
                   12541:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12542:             "filename">pkgsrc/licenses</code> for displaying. A
                   12543:             list of known licenses can be seen in this directory as
                   12544:             well as by looking at the list of (commented out)
                   12545:             <code class="varname">ACCEPTABLE_LICENSES</code>
1.45      wiz      12546:             variable settings in <code xmlns=
                   12547:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12548:             "filename">pkgsrc/mk/defaults/mk.conf</code>.</p>
1.1       grant    12549: 
1.44      gdt      12550:             <p>The use of <code class=
                   12551:             "varname">LICENSE=shareware</code>, <code class=
                   12552:             "varname">LICENSE=no-commercial-use</code>, and similar
                   12553:             language is deprecated because it does not crisply
                   12554:             refer to a particular license text. Another problem
                   12555:             with such usage is that it does not enable a user to
                   12556:             denote acceptance of the license for a single package
                   12557:             without accepting the same license text for another
                   12558:             package. In particular, this can be inappropriate when
                   12559:             e.g. one accepts a particular license to indicate to
                   12560:             pkgsrc that a fee has been paid.</p>
1.1       grant    12561:           </div>
                   12562: 
1.52      tv       12563:           <div class="sect2" lang="en">
1.1       grant    12564:             <div class="titlepage">
                   12565:               <div>
                   12566:                 <div>
1.30      wiz      12567:                   <h3 class="title"><a name=
1.38      dillo    12568:                   "installing-score-files"></a>15.5.3.&nbsp;Installing
1.30      wiz      12569:                   score files</h3>
1.1       grant    12570:                 </div>
                   12571:               </div>
                   12572:             </div>
                   12573: 
                   12574:             <p>Certain packages, most of them in the games
                   12575:             category, install a score file that allows all users on
                   12576:             the system to record their highscores. In order for
                   12577:             this to work, the binaries need to be installed setgid
                   12578:             and the score files owned by the appropriate group
                   12579:             and/or owner (traditionally the "games" user/group).
                   12580:             The following variables, documented in more detail in
1.45      wiz      12581:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   12582:             class="filename">mk/defaults/mk.conf</code>, control
                   12583:             this behaviour: <code class=
1.14      xtraeme  12584:             "varname">SETGIDGAME</code>, <code class=
                   12585:             "varname">GAMEDATAMODE</code>, <code class=
                   12586:             "varname">GAMEGRP</code>, <code class=
                   12587:             "varname">GAMEMODE</code>, <code class=
                   12588:             "varname">GAMEOWN</code>.</p>
1.1       grant    12589: 
                   12590:             <p>Note that per default, setgid installation of games
1.14      xtraeme  12591:             is disabled; setting <code class=
                   12592:             "varname">SETGIDGAME=YES</code> will set all the other
1.1       grant    12593:             variables accordingly.</p>
                   12594: 
                   12595:             <p>A package should therefor never hard code file
1.14      xtraeme  12596:             ownership or access permissions but rely on
                   12597:             <code class="varname">INSTALL_GAME</code> and
                   12598:             <code class="varname">INSTALL_GAME_DATA</code> to set
                   12599:             these correctly.</p>
1.1       grant    12600:           </div>
                   12601: 
1.52      tv       12602:           <div class="sect2" lang="en">
1.1       grant    12603:             <div class="titlepage">
                   12604:               <div>
                   12605:                 <div>
1.52      tv       12606:                   <h3 class="title"><a name=
1.38      dillo    12607:                   "perl-scripts"></a>15.5.4.&nbsp;Packages
1.30      wiz      12608:                   containing perl scripts</h3>
1.1       grant    12609:                 </div>
                   12610:               </div>
                   12611:             </div>
                   12612: 
                   12613:             <p>If your package contains interpreted perl scripts,
1.14      xtraeme  12614:             set <code class="varname">REPLACE_PERL</code> to ensure
                   12615:             that the proper interpreter path is set. <code class=
                   12616:             "varname">REPLACE_PERL</code> should contain a list of
                   12617:             scripts, relative to <code class=
                   12618:             "varname">WRKSRC</code>, that you want adjusted.</p>
1.1       grant    12619:           </div>
                   12620: 
1.52      tv       12621:           <div class="sect2" lang="en">
1.1       grant    12622:             <div class="titlepage">
                   12623:               <div>
                   12624:                 <div>
1.52      tv       12625:                   <h3 class="title"><a name=
1.38      dillo    12626:                   "hardcoded-paths"></a>15.5.5.&nbsp;Packages with
1.1       grant    12627:                   hardcoded paths to other interpreters</h3>
                   12628:                 </div>
                   12629:               </div>
                   12630:             </div>
                   12631: 
                   12632:             <p>Your package may also contain scripts with hardcoded
                   12633:             paths to other interpreters besides (or as well as)
                   12634:             perl. To correct the full pathname to the script
                   12635:             interpreter, you need to set the following definitions
1.45      wiz      12636:             in your <code xmlns=
                   12637:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   12638:             "filename">Makefile</code> (we shall use
                   12639:             <span><strong class="command">tclsh</strong></span> in
                   12640:             this example):</p>
1.1       grant    12641:             <pre class="programlisting">
1.51      rillig   12642:     REPLACE_INTERPRETER+=   tcl
                   12643:     _REPLACE.tcl.old=       .*/bin/tclsh
                   12644:     _REPLACE.tcl.new=       ${PREFIX}/bin/tclsh
                   12645:     _REPLACE_FILES.tcl=     # list of tcl scripts which need to be fixed,
                   12646:                             # relative to ${WRKSRC}, just as in REPLACE_PERL
1.1       grant    12647: </pre>
                   12648:           </div>
                   12649: 
1.52      tv       12650:           <div class="sect2" lang="en">
1.1       grant    12651:             <div class="titlepage">
                   12652:               <div>
                   12653:                 <div>
1.52      tv       12654:                   <h3 class="title"><a name=
1.38      dillo    12655:                   "perl-modules"></a>15.5.6.&nbsp;Packages
1.30      wiz      12656:                   installing perl modules</h3>
1.1       grant    12657:                 </div>
                   12658:               </div>
                   12659:             </div>
                   12660: 
                   12661:             <p>Makefiles of packages providing perl5 modules should
1.45      wiz      12662:             include the Makefile fragment <code xmlns=
                   12663:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12664:             "filename">../../lang/perl5/module.mk</code>. It
                   12665:             provides a <span><strong class=
                   12666:             "command">do-configure</strong></span> target for the
                   12667:             standard perl configuration for such modules as well as
                   12668:             various hooks to tune this configuration. See comments
                   12669:             in this file for details.</p>
1.1       grant    12670: 
                   12671:             <p>Perl5 modules will install into different places
                   12672:             depending on the version of perl used during the build
                   12673:             process. To address this, pkgsrc will append lines to
1.45      wiz      12674:             the <code xmlns=
                   12675:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   12676:             "filename">PLIST</code> corresponding to the files
                   12677:             listed in the installed <code xmlns=
                   12678:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12679:             "filename">.packlist</code> file generated by most
                   12680:             perl5 modules. This is invoked by defining <code class=
                   12681:             "varname">PERL5_PACKLIST</code> to a space-separated
                   12682:             list of paths to packlist files, e.g.:</p>
1.1       grant    12683:             <pre class="programlisting">
1.51      rillig   12684:     PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist
1.1       grant    12685: </pre>
                   12686: 
1.14      xtraeme  12687:             <p>The variables <code class=
                   12688:             "varname">PERL5_SITELIB</code>, <code class=
                   12689:             "varname">PERL5_SITEARCH</code>, and <code class=
                   12690:             "varname">PERL5_ARCHLIB</code> represent the three
1.1       grant    12691:             locations in which perl5 modules may be installed, and
                   12692:             may be used by perl5 packages that don't have a
                   12693:             packlist. These three variables are also substituted
1.45      wiz      12694:             for in the <code xmlns=
                   12695:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   12696:             "filename">PLIST</code>.</p>
1.1       grant    12697:           </div>
                   12698: 
1.52      tv       12699:           <div class="sect2" lang="en">
1.1       grant    12700:             <div class="titlepage">
                   12701:               <div>
                   12702:                 <div>
1.52      tv       12703:                   <h3 class="title"><a name=
1.38      dillo    12704:                   "faq.info-files"></a>15.5.7.&nbsp;Packages
1.1       grant    12705:                   installing info files</h3>
                   12706:                 </div>
                   12707:               </div>
                   12708:             </div>
                   12709: 
                   12710:             <p>Some packages install info files or use the
                   12711:             &#8220;<span class="quote">makeinfo</span>&#8221; or
                   12712:             &#8220;<span class="quote">install-info</span>&#8221;
                   12713:             commands. Each of the info files:</p>
                   12714: 
                   12715:             <div class="itemizedlist">
                   12716:               <ul type="disc">
                   12717:                 <li>
                   12718:                   <p>is considered to be installed in the directory
1.45      wiz      12719:                   <code xmlns=
                   12720:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12721:                   "filename">${PREFIX}/${INFO_DIR}</code>,</p>
1.1       grant    12722:                 </li>
                   12723: 
                   12724:                 <li>
                   12725:                   <p>is registered in the Info directory file
1.45      wiz      12726:                   <code xmlns=
                   12727:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12728:                   "filename">${PREFIX}/${INFO_DIR}/dir</code>,</p>
1.1       grant    12729:                 </li>
                   12730: 
                   12731:                 <li>
                   12732:                   <p>and must be listed as a filename in the
1.14      xtraeme  12733:                   <code class="varname">INFO_FILES</code> variable
                   12734:                   in the package Makefile.</p>
1.1       grant    12735:                 </li>
                   12736:               </ul>
                   12737:             </div>
                   12738: 
1.14      xtraeme  12739:             <p><code class="varname">INFO_DIR</code> defaults to
1.1       grant    12740:             &#8220;<span class="quote">info</span>&#8221; and can
1.45      wiz      12741:             be overridden in the package Makefile. <code xmlns=
                   12742:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   12743:             "filename">INSTALL</code> and <code xmlns=
                   12744:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12745:             "filename">DEINSTALL</code> scripts will be generated
                   12746:             to handle registration of the info files in the Info
1.1       grant    12747:             directory file. The &#8220;<span class=
                   12748:             "quote">install-info</span>&#8221; command used for the
                   12749:             info files registration is either provided by the
                   12750:             system, or by a special purpose package automatically
                   12751:             added as dependency if needed.</p>
                   12752: 
                   12753:             <p>A package which needs the &#8220;<span class=
                   12754:             "quote">makeinfo</span>&#8221; command at build time
1.14      xtraeme  12755:             must define the variable <code class=
                   12756:             "varname">USE_MAKEINFO</code> in its Makefile. If a
1.1       grant    12757:             minimum version of the &#8220;<span class=
                   12758:             "quote">makeinfo</span>&#8221; command is needed it
1.14      xtraeme  12759:             should be noted with the <code class=
                   12760:             "varname">TEXINFO_REQD</code> variable in the package
1.45      wiz      12761:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   12762:             class="filename">Makefile</code>. By default, a minimum
                   12763:             version of 3.12 is required. If the system does not
                   12764:             provide a <span><strong class=
1.14      xtraeme  12765:             "command">makeinfo</strong></span> command or if it
                   12766:             does not match the required minimum, a build dependency
                   12767:             on the <a xmlns=
                   12768:             "http://www.w3.org/TR/xhtml1/transitional" href=
1.1       grant    12769:             "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/gtexinfo/README.html"
1.45      wiz      12770:             target="_top"><code xmlns="" class=
                   12771:             "filename">devel/gtexinfo</code></a> package will be
1.20      ben      12772:             added automatically.</p>
1.1       grant    12773: 
                   12774:             <p>The build and installation process of the software
                   12775:             provided by the package should not use the
1.14      xtraeme  12776:             <span><strong class=
                   12777:             "command">install-info</strong></span> command as the
                   12778:             registration of info files is the task of the package
1.45      wiz      12779:             <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   12780:             class="filename">INSTALL</code> script, and it must use
                   12781:             the appropriate <span><strong class=
1.14      xtraeme  12782:             "command">makeinfo</strong></span> command.</p>
1.1       grant    12783: 
1.47      reed     12784:             <p>To achieve this goal, the pkgsrc infrastructure
1.14      xtraeme  12785:             creates overriding scripts for the <span><strong class=
                   12786:             "command">install-info</strong></span> and
                   12787:             <span><strong class="command">makeinfo</strong></span>
                   12788:             commands in a directory listed early in <code class=
                   12789:             "varname">PATH</code>.</p>
1.1       grant    12790: 
1.14      xtraeme  12791:             <p>The script overriding <span><strong class=
                   12792:             "command">install-info</strong></span> has no effect
                   12793:             except the logging of a message. The script overriding
                   12794:             <span><strong class="command">makeinfo</strong></span>
                   12795:             logs a message and according to the value of
                   12796:             <code class="varname">USE_MAKEINFO</code> and
                   12797:             <code class="varname">TEXINFO_REQD</code> either run
                   12798:             the appropriate <span><strong class=
                   12799:             "command">makeinfo</strong></span> command or exit on
                   12800:             error.</p>
1.1       grant    12801:           </div>
                   12802: 
1.52      tv       12803:           <div class="sect2" lang="en">
1.1       grant    12804:             <div class="titlepage">
                   12805:               <div>
                   12806:                 <div>
1.52      tv       12807:                   <h3 class="title"><a name=
1.38      dillo    12808:                   "gconf2-data-files"></a>15.5.8.&nbsp;Packages
1.30      wiz      12809:                   installing GConf2 data files</h3>
1.1       grant    12810:                 </div>
                   12811:               </div>
                   12812:             </div>
                   12813: 
1.45      wiz      12814:             <p>If a package installs <code xmlns=
                   12815:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   12816:             "filename">.schemas</code> or <code xmlns=
                   12817:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12818:             "filename">.entries</code> files, used by GConf2, you
1.1       grant    12819:             need to take some extra steps to make sure they get
                   12820:             registered in the database:</p>
                   12821: 
                   12822:             <div class="orderedlist">
                   12823:               <ol type="1">
                   12824:                 <li>
1.45      wiz      12825:                   <p>Include <code xmlns=
                   12826:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12827:                   "filename">../../devel/GConf2/schemas.mk</code>
1.45      wiz      12828:                   instead of its <code xmlns=
                   12829:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12830:                   "filename">buildlink3.mk</code> file. This takes
1.1       grant    12831:                   care of rebuilding the GConf2 database at
                   12832:                   installation and deinstallation time, and tells
                   12833:                   the package where to install GConf2 data files
                   12834:                   using some standard configure arguments. It also
                   12835:                   disallows any access to the database directly
                   12836:                   from the package.</p>
                   12837:                 </li>
                   12838: 
                   12839:                 <li>
                   12840:                   <p>Ensure that the package installs its
1.45      wiz      12841:                   <code xmlns=
                   12842:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   12843:                   "filename">.schemas</code> files under
                   12844:                   <code xmlns=
                   12845:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12846:                   "filename">${PREFIX}/share/gconf/schemas</code>.
1.45      wiz      12847:                   If they get installed under <code xmlns=
                   12848:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12849:                   "filename">${PREFIX}/etc</code>, you will need to
1.1       grant    12850:                   manually patch the package.</p>
                   12851:                 </li>
                   12852: 
                   12853:                 <li>
                   12854:                   <p>Check the PLIST and remove any entries under
                   12855:                   the etc/gconf directory, as they will be handled
                   12856:                   automatically. See <a href="#faq.conf" title=
1.38      dillo    12857:                   "7.14.&nbsp;How do I change the location of configuration files?">
                   12858:                   Section&nbsp;7.14, &#8220;How do I change the
1.35      jmmv     12859:                   location of configuration files?&#8221;</a> for
                   12860:                   more information.</p>
1.1       grant    12861:                 </li>
                   12862: 
                   12863:                 <li>
1.14      xtraeme  12864:                   <p>Define the <code class=
                   12865:                   "varname">GCONF2_SCHEMAS</code> variable in your
1.45      wiz      12866:                   <code xmlns=
                   12867:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   12868:                   "filename">Makefile</code> with a list of all
                   12869:                   <code xmlns=
                   12870:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12871:                   "filename">.schemas</code> files installed by the
                   12872:                   package, if any. Names must not contain any
                   12873:                   directories in them.</p>
1.1       grant    12874:                 </li>
                   12875: 
                   12876:                 <li>
1.14      xtraeme  12877:                   <p>Define the <code class=
                   12878:                   "varname">GCONF2_ENTRIES</code> variable in your
1.45      wiz      12879:                   <code xmlns=
                   12880:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   12881:                   "filename">Makefile</code> with a list of all
                   12882:                   <code xmlns=
                   12883:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12884:                   "filename">.entries</code> files installed by the
                   12885:                   package, if any. Names must not contain any
                   12886:                   directories in them.</p>
1.1       grant    12887:                 </li>
                   12888:               </ol>
                   12889:             </div>
                   12890:           </div>
                   12891: 
1.52      tv       12892:           <div class="sect2" lang="en">
1.1       grant    12893:             <div class="titlepage">
                   12894:               <div>
                   12895:                 <div>
1.30      wiz      12896:                   <h3 class="title"><a name=
1.38      dillo    12897:                   "scrollkeeper-data-files"></a>15.5.9.&nbsp;Packages
1.30      wiz      12898:                   installing scrollkeeper data files</h3>
1.1       grant    12899:                 </div>
                   12900:               </div>
                   12901:             </div>
                   12902: 
1.45      wiz      12903:             <p>If a package installs <code xmlns=
                   12904:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12905:             "filename">.omf</code> files, used by scrollkeeper, you
                   12906:             need to take some extra steps to make sure they get
                   12907:             registered in the database:</p>
1.1       grant    12908: 
                   12909:             <div class="orderedlist">
                   12910:               <ol type="1">
                   12911:                 <li>
1.45      wiz      12912:                   <p>Include <code xmlns=
                   12913:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12914:                   "filename">../../textproc/scrollkeeper/omf.mk</code>
1.45      wiz      12915:                   instead of its <code xmlns=
                   12916:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12917:                   "filename">buildlink3.mk</code> file. This takes
1.1       grant    12918:                   care of rebuilding the scrollkeeper database at
                   12919:                   installation and deinstallation time, and
                   12920:                   disallows any access to it directly from the
                   12921:                   package.</p>
                   12922:                 </li>
                   12923: 
                   12924:                 <li>
                   12925:                   <p>Check the PLIST and remove any entries under
1.45      wiz      12926:                   the <code xmlns=
                   12927:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12928:                   "filename">libdata/scrollkeeper</code> directory,
1.1       grant    12929:                   as they will be handled automatically.</p>
                   12930:                 </li>
                   12931: 
                   12932:                 <li>
1.45      wiz      12933:                   <p>Remove the <code xmlns=
                   12934:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12935:                   "filename">share/omf</code> directory from the
                   12936:                   PLIST. It will be handled by scrollkeeper.</p>
1.1       grant    12937:                 </li>
                   12938:               </ol>
                   12939:             </div>
                   12940:           </div>
                   12941: 
1.52      tv       12942:           <div class="sect2" lang="en">
1.1       grant    12943:             <div class="titlepage">
                   12944:               <div>
                   12945:                 <div>
1.52      tv       12946:                   <h3 class="title"><a name=
1.38      dillo    12947:                   "x11-fonts"></a>15.5.10.&nbsp;Packages installing
1.1       grant    12948:                   X11 fonts</h3>
                   12949:                 </div>
                   12950:               </div>
                   12951:             </div>
                   12952: 
                   12953:             <p>If a package installs font files, you will need to
                   12954:             rebuild the fonts database in the directory where they
                   12955:             get installed at installation and deinstallation time.
1.45      wiz      12956:             This can be automatically done by using <code xmlns=
                   12957:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12958:             "filename">mk/fonts.mk</code>, which you need to
1.45      wiz      12959:             include in your <code xmlns=
                   12960:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12961:             "filename">Makefile</code>.</p>
1.1       grant    12962: 
                   12963:             <p>When the file is included, you can list the
1.14      xtraeme  12964:             directories where fonts are installed in the
                   12965:             <code class="varname">FONTS_<em class=
                   12966:             "replaceable"><code>type</code></em>_DIRS</code>
                   12967:             variables, where <em class=
                   12968:             "replaceable"><code>type</code></em> can be one of
                   12969:             &#8220;<span class="quote">TTF</span>&#8221;,
1.1       grant    12970:             &#8220;<span class="quote">TYPE1</span>&#8221; or
                   12971:             &#8220;<span class="quote">X11</span>&#8221;. Also make
1.45      wiz      12972:             sure that the database file <code xmlns=
                   12973:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  12974:             "filename">fonts.dir</code> is not listed in the
1.1       grant    12975:             PLIST.</p>
                   12976: 
                   12977:             <p>Note that you should not create new directories for
                   12978:             fonts; instead use the standard ones to avoid that the
                   12979:             user needs to manually configure his X server to find
                   12980:             them.</p>
                   12981:           </div>
                   12982: 
1.52      tv       12983:           <div class="sect2" lang="en">
1.1       grant    12984:             <div class="titlepage">
                   12985:               <div>
                   12986:                 <div>
1.52      tv       12987:                   <h3 class="title"><a name=
1.38      dillo    12988:                   "gtk2-modules"></a>15.5.11.&nbsp;Packages
1.30      wiz      12989:                   installing GTK2 modules</h3>
1.1       grant    12990:                 </div>
                   12991:               </div>
                   12992:             </div>
                   12993: 
1.47      reed     12994:             <p>If a package installs GTK2 immodules or loaders, you
1.1       grant    12995:             need to take some extra steps to get them registered in
                   12996:             the GTK2 database properly:</p>
                   12997: 
                   12998:             <div class="orderedlist">
                   12999:               <ol type="1">
                   13000:                 <li>
1.45      wiz      13001:                   <p>Include <code xmlns=
                   13002:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13003:                   "filename">../../x11/gtk2/modules.mk</code>
1.45      wiz      13004:                   instead of its <code xmlns=
                   13005:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13006:                   "filename">buildlink3.mk</code> file. This takes
                   13007:                   care of rebuilding the database at installation
                   13008:                   and deinstallation time.</p>
1.1       grant    13009:                 </li>
                   13010: 
                   13011:                 <li>
1.14      xtraeme  13012:                   <p>Set <code class=
                   13013:                   "varname">GTK2_IMMODULES=YES</code> if your
                   13014:                   package installs GTK2 immodules.</p>
1.1       grant    13015:                 </li>
                   13016: 
                   13017:                 <li>
1.14      xtraeme  13018:                   <p>Set <code class=
                   13019:                   "varname">GTK2_LOADERS=YES</code> if your package
                   13020:                   installs GTK2 loaders.</p>
1.1       grant    13021:                 </li>
                   13022: 
                   13023:                 <li>
1.47      reed     13024:                   <p>Patch the package to not touch any of the GTK2
1.1       grant    13025:                   databases directly. These are:</p>
                   13026: 
                   13027:                   <div class="itemizedlist">
                   13028:                     <ul type="disc">
                   13029:                       <li>
1.45      wiz      13030:                         <p><code xmlns=
                   13031:                         "http://www.w3.org/TR/xhtml1/transitional"
                   13032:                         class=
1.14      xtraeme  13033:                         "filename">libdata/gtk-2.0/gdk-pixbuf.loaders</code></p>
1.1       grant    13034:                       </li>
                   13035: 
                   13036:                       <li>
1.45      wiz      13037:                         <p><code xmlns=
                   13038:                         "http://www.w3.org/TR/xhtml1/transitional"
                   13039:                         class=
1.14      xtraeme  13040:                         "filename">libdata/gtk-2.0/gtk.immodules</code></p>
1.1       grant    13041:                       </li>
                   13042:                     </ul>
                   13043:                   </div>
                   13044:                 </li>
                   13045: 
                   13046:                 <li>
                   13047:                   <p>Check the PLIST and remove any entries under
1.45      wiz      13048:                   the <code xmlns=
                   13049:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   13050:                   "filename">libdata/gtk-2.0</code> directory, as
                   13051:                   they will be handled automatically.</p>
1.1       grant    13052:                 </li>
                   13053:               </ol>
                   13054:             </div>
                   13055:           </div>
                   13056: 
1.52      tv       13057:           <div class="sect2" lang="en">
1.1       grant    13058:             <div class="titlepage">
                   13059:               <div>
                   13060:                 <div>
1.52      tv       13061:                   <h3 class="title"><a name=
1.38      dillo    13062:                   "sgml-xml-data"></a>15.5.12.&nbsp;Packages
1.30      wiz      13063:                   installing SGML or XML data</h3>
1.1       grant    13064:                 </div>
                   13065:               </div>
                   13066:             </div>
                   13067: 
                   13068:             <p>If a package installs SGML or XML data files that
                   13069:             need to be registered in system-wide catalogs (like
                   13070:             DTDs, sub-catalogs, etc.), you need to take some extra
                   13071:             steps:</p>
                   13072: 
                   13073:             <div class="orderedlist">
                   13074:               <ol type="1">
                   13075:                 <li>
1.45      wiz      13076:                   <p>Include <code xmlns=
                   13077:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13078:                   "filename">../../textproc/xmlcatmgr/catalogs.mk</code>
1.45      wiz      13079:                   in your <code xmlns=
                   13080:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   13081:                   "filename">Makefile</code>, which takes care of
                   13082:                   registering those files in system-wide catalogs
                   13083:                   at installation and deinstallation time.</p>
1.1       grant    13084:                 </li>
                   13085: 
                   13086:                 <li>
1.14      xtraeme  13087:                   <p>Set <code class="varname">SGML_CATALOGS</code>
                   13088:                   to the full path of any SGML catalogs installed
                   13089:                   by the package.</p>
1.1       grant    13090:                 </li>
                   13091: 
                   13092:                 <li>
1.14      xtraeme  13093:                   <p>Set <code class="varname">XML_CATALOGS</code>
                   13094:                   to the full path of any XML catalogs installed by
1.1       grant    13095:                   the package.</p>
                   13096:                 </li>
                   13097: 
                   13098:                 <li>
1.14      xtraeme  13099:                   <p>Set <code class="varname">SGML_ENTRIES</code>
                   13100:                   to individual entries to be added to the SGML
1.1       grant    13101:                   catalog. These come in groups of three strings;
                   13102:                   see xmlcatmgr(1) for more information
                   13103:                   (specifically, arguments recognized by the 'add'
                   13104:                   action). Note that you will normally not use this
                   13105:                   variable.</p>
                   13106:                 </li>
                   13107: 
                   13108:                 <li>
1.14      xtraeme  13109:                   <p>Set <code class="varname">XML_ENTRIES</code>
                   13110:                   to individual entries to be added to the XML
1.1       grant    13111:                   catalog. These come in groups of three strings;
                   13112:                   see xmlcatmgr(1) for more information
                   13113:                   (specifically, arguments recognized by the 'add'
                   13114:                   action). Note that you will normally not use this
                   13115:                   variable.</p>
                   13116:                 </li>
                   13117:               </ol>
                   13118:             </div>
                   13119:           </div>
                   13120: 
1.52      tv       13121:           <div class="sect2" lang="en">
1.1       grant    13122:             <div class="titlepage">
                   13123:               <div>
                   13124:                 <div>
1.52      tv       13125:                   <h3 class="title"><a name=
1.38      dillo    13126:                   "mime-database"></a>15.5.13.&nbsp;Packages
1.30      wiz      13127:                   installing extensions to the MIME database</h3>
1.1       grant    13128:                 </div>
                   13129:               </div>
                   13130:             </div>
                   13131: 
                   13132:             <p>If a package provides extensions to the MIME
1.45      wiz      13133:             database by installing <code xmlns=
                   13134:             "http://www.w3.org/TR/xhtml1/transitional" class=
                   13135:             "filename">.xml</code> files inside <code xmlns=
                   13136:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13137:             "filename">${PREFIX}/share/mime/packages</code>, you
                   13138:             need to take some extra steps to ensure that the
                   13139:             database is kept consistent with respect to these new
                   13140:             files:</p>
1.1       grant    13141: 
                   13142:             <div class="orderedlist">
                   13143:               <ol type="1">
                   13144:                 <li>
1.45      wiz      13145:                   <p>Include <code xmlns=
                   13146:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13147:                   "filename">../../databases/shared-mime-info/mimedb.mk</code>
1.45      wiz      13148:                   (avoid using the <code xmlns=
                   13149:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13150:                   "filename">buildlink3.mk</code> file from this
                   13151:                   same directory, which is reserved for inclusion
1.45      wiz      13152:                   from other <code xmlns=
                   13153:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13154:                   "filename">buildlink3.mk</code> files). It takes
                   13155:                   care of rebuilding the MIME database at
                   13156:                   installation and deinstallation time, and
                   13157:                   disallows any access to it directly from the
1.1       grant    13158:                   package.</p>
                   13159:                 </li>
                   13160: 
                   13161:                 <li>
                   13162:                   <p>Check the PLIST and remove any entries under
1.45      wiz      13163:                   the <code xmlns=
                   13164:                   "http://www.w3.org/TR/xhtml1/transitional" class=
                   13165:                   "filename">share/mime</code> directory,
                   13166:                   <span class="emphasis"><em>except</em></span> for
                   13167:                   files saved under <code xmlns=
                   13168:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13169:                   "filename">share/mime/packages</code>. The former
1.1       grant    13170:                   are handled automatically by the
1.47      reed     13171:                   update-mime-database program, but the latter are
1.1       grant    13172:                   package-dependent and must be removed by the
                   13173:                   package that installed them in the first
                   13174:                   place.</p>
                   13175:                 </li>
                   13176: 
                   13177:                 <li>
1.45      wiz      13178:                   <p>Remove any <code xmlns=
                   13179:                   "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13180:                   "filename">share/mime/*</code> directories from
                   13181:                   the PLIST. They will be handled by the
1.1       grant    13182:                   shared-mime-info package.</p>
                   13183:                 </li>
                   13184:               </ol>
                   13185:             </div>
                   13186:           </div>
                   13187: 
1.52      tv       13188:           <div class="sect2" lang="en">
1.1       grant    13189:             <div class="titlepage">
                   13190:               <div>
                   13191:                 <div>
1.52      tv       13192:                   <h3 class="title"><a name=
1.38      dillo    13193:                   "intltool"></a>15.5.14.&nbsp;Packages using
1.1       grant    13194:                   intltool</h3>
                   13195:                 </div>
                   13196:               </div>
                   13197:             </div>
                   13198: 
                   13199:             <p>If a package uses intltool during its build, include
1.45      wiz      13200:             the <code xmlns=
                   13201:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13202:             "filename">../../textproc/intltool/buildlink3.mk</code>
1.1       grant    13203:             file, which forces it to use the intltool package
                   13204:             provided by pkgsrc, instead of the one bundled with the
                   13205:             distribution file.</p>
                   13206: 
                   13207:             <p>This tracks intltool's build-time dependencies and
                   13208:             uses the latest available version; this way, the
                   13209:             package benefits of any bug fixes that may have
                   13210:             appeared since it was released.</p>
                   13211:           </div>
1.18      xtraeme  13212: 
1.52      tv       13213:           <div class="sect2" lang="en">
1.18      xtraeme  13214:             <div class="titlepage">
                   13215:               <div>
                   13216:                 <div>
1.52      tv       13217:                   <h3 class="title"><a name=
1.38      dillo    13218:                   "startup-scripts"></a>15.5.15.&nbsp;Packages
1.30      wiz      13219:                   installing startup scripts</h3>
1.18      xtraeme  13220:                 </div>
                   13221:               </div>
                   13222:             </div>
                   13223: 
                   13224:             <p>If a package contains a rc.d script, it won't be
                   13225:             copied into the startup directory by default, but you
                   13226:             can enable it, by adding the option <code class=
1.45      wiz      13227:             "varname">PKG_RCD_SCRIPTS=YES</code> in <code xmlns=
                   13228:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.18      xtraeme  13229:             "filename">/etc/mk.conf</code>. This option will copy
1.45      wiz      13230:             the scripts into <code xmlns=
                   13231:             "http://www.w3.org/TR/xhtml1/transitional" class=
1.18      xtraeme  13232:             "filename">/etc/rc.d</code> when a package is
                   13233:             installed, and it will automatically remove the scripts
                   13234:             when the package is deinstalled.</p>
                   13235:           </div>
1.1       grant    13236:         </div>
                   13237: 
1.52      tv       13238:         <div class="sect1" lang="en">
1.1       grant    13239:           <div class="titlepage">
                   13240:             <div>
                   13241:               <div>
                   13242:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    13243:                 "feedback-to-author"></a>15.6.&nbsp;Feedback to the
1.30      wiz      13244:                 author</h2>
1.1       grant    13245:               </div>
                   13246:             </div>
                   13247:           </div>
                   13248: 
                   13249:           <p>If you have found any bugs in the package you make
                   13250:           available, if you had to do special steps to make it run
                   13251:           under NetBSD or if you enhanced the software in various
                   13252:           other ways, be sure to report these changes back to the
                   13253:           original author of the program! With that kind of
                   13254:           support, the next release of the program can incorporate
                   13255:           these fixes, and people not using the NetBSD packages
                   13256:           system can win from your efforts.</p>
                   13257: 
                   13258:           <p>Support the idea of free software!</p>
                   13259:         </div>
                   13260:       </div>
                   13261: 
1.52      tv       13262:       <div class="chapter" lang="en">
1.1       grant    13263:         <div class="titlepage">
                   13264:           <div>
                   13265:             <div>
1.52      tv       13266:               <h2 class="title"><a name=
1.38      dillo    13267:               "debug"></a>Chapter&nbsp;16.&nbsp;Debugging</h2>
1.1       grant    13268:             </div>
                   13269:           </div>
                   13270:         </div>
                   13271: 
                   13272:         <p>To check out all the gotchas when building a package,
                   13273:         here are the steps that I do in order to get a package
                   13274:         working. Please note this is basically the same as what was
                   13275:         explained in the previous sections, only with some
                   13276:         debugging aids.</p>
                   13277: 
                   13278:         <div class="itemizedlist">
                   13279:           <ul type="disc">
                   13280:             <li>
1.14      xtraeme  13281:               <p>Be sure to set <code class=
1.45      wiz      13282:               "varname">PKG_DEVELOPER=1</code> in <code xmlns=
                   13283:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13284:               "filename">/etc/mk.conf</code></p>
1.1       grant    13285:             </li>
                   13286: 
                   13287:             <li>
                   13288:               <p>Install <a xmlns=
                   13289:               "http://www.w3.org/TR/xhtml1/transitional" href=
                   13290:               "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/url2pkg/README.html"
1.45      wiz      13291:               target="_top"><code xmlns="" class=
                   13292:               "filename">pkgtools/url2pkg</code></a>, create a
1.20      ben      13293:               directory for a new package, change into it, then run
                   13294:               <span><strong class=
                   13295:               "command">url2pkg</strong></span>:</p>
1.1       grant    13296:               <pre class="screen">
1.14      xtraeme  13297: <code class="prompt">%</code> <strong class=
                   13298: "userinput"><code>mkdir /usr/pkgsrc/<em class=
                   13299: "replaceable"><code>category</code></em>/<em class=
                   13300: "replaceable"><code>examplepkg</code></em></code></strong>
                   13301: <code class="prompt">%</code> <strong class=
                   13302: "userinput"><code>cd /usr/pkgsrc/<em class=
                   13303: "replaceable"><code>category</code></em>/<em class=
                   13304: "replaceable"><code>examplepkg</code></em></code></strong>
                   13305: <code class="prompt">%</code> <strong class=
                   13306: "userinput"><code>url2pkg http://www.example.com/path/to/distfile.tar.gz</code></strong>
1.1       grant    13307: </pre>
                   13308:             </li>
                   13309: 
                   13310:             <li>
1.45      wiz      13311:               <p>Edit the <code xmlns=
                   13312:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   13313:               "filename">Makefile</code> as requested.</p>
1.1       grant    13314:             </li>
                   13315: 
                   13316:             <li>
1.45      wiz      13317:               <p>Fill in the <code xmlns=
                   13318:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   13319:               "filename">DESCR</code> file</p>
1.1       grant    13320:             </li>
                   13321: 
                   13322:             <li>
1.14      xtraeme  13323:               <p>Run <span><strong class="command">make
                   13324:               configure</strong></span></p>
1.1       grant    13325:             </li>
                   13326: 
                   13327:             <li>
                   13328:               <p>Add any dependencies glimpsed from documentation
1.45      wiz      13329:               and the configure step to the package's <code xmlns=
                   13330:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13331:               "filename">Makefile</code>.</p>
1.1       grant    13332:             </li>
                   13333: 
                   13334:             <li>
                   13335:               <p>Make the package compile, doing multiple rounds
                   13336:               of</p>
                   13337:               <pre class="screen">
1.14      xtraeme  13338: <code class="prompt">%</code> <strong class=
                   13339: "userinput"><code>make</code></strong>
                   13340: <code class="prompt">%</code> <strong class=
                   13341: "userinput"><code>pkgvi ${WRKSRC}/some/file/that/does/not/compile</code></strong>
                   13342: <code class="prompt">%</code> <strong class=
                   13343: "userinput"><code>mkpatches</code></strong>
                   13344: <code class="prompt">%</code> <strong class=
                   13345: "userinput"><code>patchdiff</code></strong>
                   13346: <code class="prompt">%</code> <strong class=
                   13347: "userinput"><code>mv ${WRKDIR}/.newpatches/* patches</code></strong>
                   13348: <code class="prompt">%</code> <strong class=
                   13349: "userinput"><code>make mps</code></strong>
                   13350: <code class="prompt">%</code> <strong class=
                   13351: "userinput"><code>make clean</code></strong>
1.1       grant    13352: </pre>
                   13353: 
                   13354:               <p>Doing as non-root user will ensure that no files
                   13355:               are modified that shouldn't be, especially during the
1.14      xtraeme  13356:               build phase. <span><strong class=
                   13357:               "command">mkpatches</strong></span>,
                   13358:               <span><strong class=
                   13359:               "command">patchdiff</strong></span> and
                   13360:               <span><strong class="command">pkgvi</strong></span>
                   13361:               are from the <a xmlns=
1.1       grant    13362:               "http://www.w3.org/TR/xhtml1/transitional" href=
                   13363:               "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdiff/README.html"
1.45      wiz      13364:               target="_top"><code xmlns="" class=
                   13365:               "filename">pkgtools/pkgdiff</code></a> package.</p>
1.1       grant    13366:             </li>
                   13367: 
                   13368:             <li>
1.45      wiz      13369:               <p>Look at the <code xmlns=
                   13370:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13371:               "filename">Makefile</code>, fix if necessary; see
                   13372:               <a href="#components.Makefile" title=
1.38      dillo    13373:               "8.1.&nbsp;Makefile">Section&nbsp;8.1,
1.45      wiz      13374:               &#8220;<code xmlns=
                   13375:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13376:               "filename">Makefile</code>&#8221;</a>.</p>
1.1       grant    13377:             </li>
                   13378: 
                   13379:             <li>
1.45      wiz      13380:               <p>Generate a <code xmlns=
                   13381:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13382:               "filename">PLIST</code>:</p>
1.1       grant    13383:               <pre class="screen">
1.14      xtraeme  13384: <code class="prompt">#</code> <strong class=
                   13385: "userinput"><code>make install</code></strong>
                   13386: <code class="prompt">#</code> <strong class=
                   13387: "userinput"><code>make print-PLIST &gt;PLIST</code></strong>
                   13388: <code class="prompt">#</code> <strong class=
                   13389: "userinput"><code>make deinstall</code></strong>
                   13390: <code class="prompt">#</code> <strong class=
                   13391: "userinput"><code>make install</code></strong>
                   13392: <code class="prompt">#</code> <strong class=
                   13393: "userinput"><code>make deinstall</code></strong>
1.1       grant    13394: </pre>
                   13395: 
1.45      wiz      13396:               <p>You usually need to be <code xmlns=
                   13397:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13398:               "username">root</code> to do this. Look if there are
1.1       grant    13399:               any files left:</p>
                   13400:               <pre class="screen">
1.14      xtraeme  13401: <code class="prompt">#</code> <strong class=
                   13402: "userinput"><code>make print-PLIST</code></strong>
1.1       grant    13403: </pre>
                   13404: 
                   13405:               <p>If this reveals any files that are missing in
1.45      wiz      13406:               <code xmlns=
                   13407:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   13408:               "filename">PLIST</code>, add them.</p>
1.1       grant    13409:             </li>
                   13410: 
                   13411:             <li>
1.45      wiz      13412:               <p>Now that the <code xmlns=
                   13413:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   13414:               "filename">PLIST</code> is OK, install the package
                   13415:               again and make a binary package:</p>
1.1       grant    13416:               <pre class="screen">
1.14      xtraeme  13417: <code class="prompt">#</code> <strong class=
                   13418: "userinput"><code>make reinstall</code></strong>
                   13419: <code class="prompt">#</code> <strong class=
                   13420: "userinput"><code>make package</code></strong>
1.1       grant    13421: </pre>
                   13422:             </li>
                   13423: 
                   13424:             <li>
                   13425:               <p>Delete the installed package:</p>
                   13426:               <pre class="screen">
1.14      xtraeme  13427: <code class="prompt">#</code> <strong class=
                   13428: "userinput"><code>pkg_delete blub</code></strong>
1.1       grant    13429: </pre>
                   13430:             </li>
                   13431: 
                   13432:             <li>
1.14      xtraeme  13433:               <p>Repeat the above <span><strong class=
                   13434:               "command">make print-PLIST</strong></span> command,
                   13435:               which shouldn't find anything now:</p>
1.1       grant    13436:               <pre class="screen">
1.14      xtraeme  13437: <code class="prompt">#</code> <strong class=
                   13438: "userinput"><code>make print-PLIST</code></strong>
1.1       grant    13439: </pre>
                   13440:             </li>
                   13441: 
                   13442:             <li>
                   13443:               <p>Reinstall the binary package:</p>
                   13444:               <pre class="screen">
1.14      xtraeme  13445: <code class="prompt">#</code> <strong class=
                   13446: "userinput"><code>pkgadd .../blub.tgz</code></strong>
1.1       grant    13447: </pre>
                   13448:             </li>
                   13449: 
                   13450:             <li>
                   13451:               <p>Play with it. Make sure everything works.</p>
                   13452:             </li>
                   13453: 
                   13454:             <li>
1.14      xtraeme  13455:               <p>Run <span><strong class=
                   13456:               "command">pkglint</strong></span> from <a xmlns=
1.1       grant    13457:               "http://www.w3.org/TR/xhtml1/transitional" href=
                   13458:               "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkglint/README.html"
1.45      wiz      13459:               target="_top"><code xmlns="" class=
                   13460:               "filename">pkgtools/pkglint</code></a>, and fix the
1.20      ben      13461:               problems it reports:</p>
1.1       grant    13462:               <pre class="screen">
1.14      xtraeme  13463: <code class="prompt">#</code> <strong class=
                   13464: "userinput"><code>pkglint</code></strong>
1.1       grant    13465: </pre>
                   13466:             </li>
                   13467: 
                   13468:             <li>
                   13469:               <p>Submit (or commit, if you have cvs access); see
                   13470:               <a href="#submit" title=
1.38      dillo    13471:               "Chapter&nbsp;17.&nbsp;Submitting and Committing">Chapter&nbsp;17,
1.1       grant    13472:               <i>Submitting and Committing</i></a>.</p>
                   13473:             </li>
                   13474:           </ul>
                   13475:         </div>
                   13476:       </div>
                   13477: 
1.52      tv       13478:       <div class="chapter" lang="en">
1.1       grant    13479:         <div class="titlepage">
                   13480:           <div>
                   13481:             <div>
1.52      tv       13482:               <h2 class="title"><a name=
1.38      dillo    13483:               "submit"></a>Chapter&nbsp;17.&nbsp;Submitting and
1.1       grant    13484:               Committing</h2>
                   13485:             </div>
                   13486:           </div>
                   13487:         </div>
                   13488: 
                   13489:         <div class="toc">
                   13490:           <p><b>Table of Contents</b></p>
                   13491: 
                   13492:           <dl>
1.30      wiz      13493:             <dt><span class="sect1"><a href=
1.38      dillo    13494:             "#submitting-your-package">17.1. Submitting your
1.30      wiz      13495:             packages</a></span></dt>
1.1       grant    13496: 
1.30      wiz      13497:             <dt><span class="sect1"><a href=
1.41      wiz      13498:             "#general-notes-for-changes">17.2. General notes when
                   13499:             adding, updating, or removing packages</a></span></dt>
                   13500: 
                   13501:             <dt><span class="sect1"><a href=
                   13502:             "#committing-importing">17.3. Committing: Importing a
1.30      wiz      13503:             package into CVS</a></span></dt>
1.1       grant    13504: 
1.30      wiz      13505:             <dt><span class="sect1"><a href=
1.41      wiz      13506:             "#updating-package">17.4. Updating a package to a newer
1.30      wiz      13507:             version</a></span></dt>
1.1       grant    13508: 
1.41      wiz      13509:             <dt><span class="sect1"><a href="#moving-package">17.5.
1.2       hubertf  13510:             Moving a package in pkgsrc</a></span></dt>
1.1       grant    13511:           </dl>
                   13512:         </div>
                   13513: 
1.52      tv       13514:         <div class="sect1" lang="en">
1.1       grant    13515:           <div class="titlepage">
                   13516:             <div>
                   13517:               <div>
                   13518:                 <h2 class="title" style="clear: both"><a name=
1.38      dillo    13519:                 "submitting-your-package"></a>17.1.&nbsp;Submitting
1.30      wiz      13520:                 your packages</h2>
1.1       grant    13521:               </div>
                   13522:             </div>
                   13523:           </div>
                   13524: 
                   13525:           <p>You have to separate between binary and
                   13526:           &#8220;<span class="quote">normal</span>&#8221; (source)
                   13527:           packages here:</p>
                   13528: 
                   13529:           <div class="itemizedlist">
                   13530:             <ul type="disc">
                   13531:               <li>
                   13532:                 <p>precompiled binary packages</p>
                   13533: 
                   13534:                 <p>Our policy is that we accept binaries only from
                   13535:                 pkgsrc developers to guarantee that the packages
                   13536:                 don't contain any trojan horses etc. This is not to
1.13      hubertf  13537:                 annoy anyone but rather to protect our users!
1.1       grant    13538:                 You're still free to put up your home-made binary
1.13      hubertf  13539:                 packages and tell the world where to get them.
                   13540:                 NetBSD developers doing bulk builds and wanting to
                   13541:                 upload them please see <a href="#bulk-upload"
1.38      dillo    13542:                 title="6.3.8.&nbsp;Uploading results of a bulk build">
                   13543:                 Section&nbsp;6.3.8, &#8220;Uploading results of a
1.13      hubertf  13544:                 bulk build&#8221;</a>.</p>
1.1       grant    13545:               </li>
                   13546: 
                   13547:               <li>
                   13548:                 <p>packages</p>
                   13549: 
                   13550:                 <p>First, check that your package is complete,
                   13551:                 compiles and runs well; see <a href="#debug" title=
1.38      dillo    13552:                 "Chapter&nbsp;16.&nbsp;Debugging">Chapter&nbsp;16,
1.1       grant    13553:                 <i>Debugging</i></a> and the rest of this document.
1.24      wiz      13554:                 Next, generate an uuencoded gzipped <a href=
                   13555:                 "http://netbsd.gw.com/cgi-bin/man-cgi?tar+1+NetBSD-current">
                   13556:                 <span class="citerefentry"><span class=
                   13557:                 "refentrytitle">tar</span>(1)</span></a> archive,
1.1       grant    13558:                 preferably with all files in a single directory.
1.14      xtraeme  13559:                 Finally, <span><strong class=
                   13560:                 "command">send-pr</strong></span> with category
1.1       grant    13561:                 &#8220;<span class="quote">pkg</span>&#8221;, a
                   13562:                 synopsis which includes the package name and
                   13563:                 version number, a short description of your package
                   13564:                 (contents of the COMMENT variable or DESCR file are
                   13565:                 OK) and attach the archive to your PR.</p>
                   13566: 
                   13567:                 <p>If you want to submit several packages, please
                   13568:                 send a separate PR for each one, it's easier for us
                   13569:                 to track things that way.</p>
                   13570: 
                   13571:                 <p>Alternatively, you can also import new packages
                   13572:                 into pkgsrc-wip (&#8220;<span class="quote">pkgsrc
                   13573:                 work-in-progress</span>&#8221;); see the homepage
                   13574:                 at <a href="http://pkgsrc-wip.sourceforge.net/"
                   13575:                 target=
                   13576:                 "_top">http://pkgsrc-wip.sourceforge.net/</a> for
                   13577:                 details.</p>
                   13578:               </li>
                   13579:             </ul>
                   13580:           </div>
                   13581:         </div>
                   13582: 
1.52      tv       13583:         <div class="sect1" lang="en">
1.1       grant    13584:           <div class="titlepage">
                   13585:             <div>
                   13586:               <div>
                   13587:                 <h2 class="title" style="clear: both"><a name=
1.41      wiz      13588:                 "general-notes-for-changes"></a>17.2.&nbsp;General
                   13589:                 notes when adding, updating, or removing
                   13590:                 packages</h2>
                   13591:               </div>
                   13592:             </div>
                   13593:           </div>
                   13594: 
                   13595:           <p>Please note all package additions, updates, moves, and
1.45      wiz      13596:           removals in <code xmlns=
                   13597:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.41      wiz      13598:           "filename">pkgsrc/doc/CHANGES</code>. It's very important
                   13599:           to keep this file up to date and conforming to the
                   13600:           existing format, because it will be used by scripts to
                   13601:           automatically update pages on <a href=
                   13602:           "http://www.NetBSD.org/" target="_top">www.NetBSD.org</a>
1.45      wiz      13603:           and other sites. Additionally, check the <code xmlns=
                   13604:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.41      wiz      13605:           "filename">pkgsrc/doc/TODO</code> file and remove the
                   13606:           entry for the package you updated or removed, in case it
                   13607:           was mentioned there.</p>
                   13608: 
                   13609:           <p>There is a make target that helps in creating proper
1.45      wiz      13610:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   13611:           class="filename">CHANGES</code> entries:
1.41      wiz      13612:           <span><strong class="command">make
                   13613:           changes-entry</strong></span>. It uses the optional
                   13614:           <code class="varname">CTYPE</code> and <code class=
                   13615:           "varname">NETBSD_LOGIN_NAME</code> variables. The general
1.45      wiz      13616:           usage is to first make sure that your <code xmlns=
                   13617:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.41      wiz      13618:           "filename">CHANGES</code> file is up-to-date (to avoid
                   13619:           having to resolve conflicts later-on) and then to
                   13620:           <span><strong class="command">cd</strong></span> to the
                   13621:           package directory. For package updates,
                   13622:           <span><strong class="command">make
                   13623:           changes-entry</strong></span> is enough. For new
                   13624:           packages, or package moves or removals, set the
                   13625:           <code class="varname">CTYPE</code> variable on the
                   13626:           command line to "Added", "Moved", or "Removed". You can
                   13627:           set <code class="varname">NETBSD_LOGIN_NAME</code> in
1.45      wiz      13628:           <code xmlns="http://www.w3.org/TR/xhtml1/transitional"
                   13629:           class="filename">/etc/mk.conf</code> if your local login
                   13630:           name is not the same as your NetBSD login name. Don't
                   13631:           forget to commit the changes to <code xmlns=
                   13632:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.41      wiz      13633:           "filename">pkgsrc/doc/CHANGES</code>!</p>
                   13634:         </div>
                   13635: 
1.52      tv       13636:         <div class="sect1" lang="en">
1.41      wiz      13637:           <div class="titlepage">
                   13638:             <div>
                   13639:               <div>
                   13640:                 <h2 class="title" style="clear: both"><a name=
                   13641:                 "committing-importing"></a>17.3.&nbsp;Committing:
1.30      wiz      13642:                 Importing a package into CVS</h2>
1.1       grant    13643:               </div>
                   13644:             </div>
                   13645:           </div>
                   13646: 
                   13647:           <p>This section is only of interest for pkgsrc developers
                   13648:           with write access to the pkgsrc repository. Please
                   13649:           remember that cvs imports files relative to the current
                   13650:           working directory, and that the pathname that you give
1.14      xtraeme  13651:           the <span><strong class="command">cvs
                   13652:           import</strong></span> command is so that it knows where
                   13653:           to place the files in the repository. Newly created
                   13654:           packages should be imported with a vendor tag of
                   13655:           &#8220;<span class="quote">TNF</span>&#8221; and a
                   13656:           release tag of &#8220;<span class=
                   13657:           "quote">pkgsrc-base</span>&#8221;, e.g:</p>
1.1       grant    13658:           <pre class="programlisting">
1.51      rillig   13659:     <code class="prompt">$</code> cd .../pkgsrc/category/pkgname
                   13660:     <code class=
                   13661: "prompt">$</code> cvs import pkgsrc/category/pkgname TNF pkgsrc-base
1.1       grant    13662: </pre>
                   13663: 
                   13664:           <p>Remember to move the directory from which you imported
                   13665:           out of the way, or cvs will complain the next time you
                   13666:           &#8220;<span class="quote">cvs update</span>&#8221; your
                   13667:           source tree. Also don't forget to add the new package to
1.45      wiz      13668:           the category's <code xmlns=
                   13669:           "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13670:           "filename">Makefile</code>.</p>
1.1       grant    13671: 
                   13672:           <p>The commit message of the initial import should
1.45      wiz      13673:           include part of the <code xmlns=
                   13674:           "http://www.w3.org/TR/xhtml1/transitional" class=
                   13675:           "filename">DESCR</code> file, so people reading the
                   13676:           mailing lists know what the package is/does.</p>
1.1       grant    13677: 
                   13678:           <p>For new packages, &#8220;<span class="quote">cvs
                   13679:           import</span>&#8221; is preferred to &#8220;<span class=
                   13680:           "quote">cvs add</span>&#8221; because the former gets
                   13681:           everything with a single command, and provides a
                   13682:           consistent tag.</p>
                   13683:         </div>
                   13684: 
1.52      tv       13685:         <div class="sect1" lang="en">
1.1       grant    13686:           <div class="titlepage">
                   13687:             <div>
                   13688:               <div>
                   13689:                 <h2 class="title" style="clear: both"><a name=
1.41      wiz      13690:                 "updating-package"></a>17.4.&nbsp;Updating a
1.30      wiz      13691:                 package to a newer version</h2>
1.1       grant    13692:               </div>
                   13693:             </div>
                   13694:           </div>
                   13695: 
                   13696:           <p>Please always put a concise, appropriate and relevant
                   13697:           summary of the changes between old and new versions into
                   13698:           the commit log when updating a package. There are various
                   13699:           reasons for this:</p>
                   13700: 
                   13701:           <div class="itemizedlist">
                   13702:             <ul type="disc">
                   13703:               <li>
                   13704:                 <p>A URL is volatile, and can change over time. It
                   13705:                 may go away completely or its information may be
                   13706:                 overwritten by newer information.</p>
                   13707:               </li>
                   13708: 
                   13709:               <li>
                   13710:                 <p>Having the change information between old and
                   13711:                 new versions in our CVS repository is very useful
                   13712:                 for people who use either cvs or anoncvs.</p>
                   13713:               </li>
                   13714: 
                   13715:               <li>
                   13716:                 <p>Having the change information between old and
                   13717:                 new versions in our CVS repository is very useful
                   13718:                 for people who read the pkgsrc-changes mailing
                   13719:                 list, so that they can make tactical decisions
                   13720:                 about when to upgrade the package.</p>
                   13721:               </li>
                   13722:             </ul>
                   13723:           </div>
                   13724: 
1.18      xtraeme  13725:           <p>Please also recognize that, just because a new version
1.1       grant    13726:           of a package has been released, it should not
                   13727:           automatically be upgraded in the CVS repository. We
                   13728:           prefer to be conservative in the packages that are
                   13729:           included in pkgsrc - development or beta packages are not
                   13730:           really the best thing for most places in which pkgsrc is
                   13731:           used. Please use your judgement about what should go into
                   13732:           pkgsrc, and bear in mind that stability is to be
                   13733:           preferred above new and possibly untested features.</p>
                   13734:         </div>
                   13735: 
1.52      tv       13736:         <div class="sect1" lang="en">
1.1       grant    13737:           <div class="titlepage">
                   13738:             <div>
                   13739:               <div>
                   13740:                 <h2 class="title" style="clear: both"><a name=
1.41      wiz      13741:                 "moving-package"></a>17.5.&nbsp;Moving a package in
1.30      wiz      13742:                 pkgsrc</h2>
1.1       grant    13743:               </div>
                   13744:             </div>
                   13745:           </div>
                   13746: 
                   13747:           <div class="orderedlist">
                   13748:             <ol type="1">
                   13749:               <li>
                   13750:                 <p>Make a copy of the directory somewhere else.</p>
                   13751:               </li>
                   13752: 
                   13753:               <li>
                   13754:                 <p>Remove all CVS dirs.</p>
                   13755: 
                   13756:                 <p>Alternatively to the first two steps you can
                   13757:                 also do:</p>
                   13758:                 <pre class="screen">
1.14      xtraeme  13759: <code class="prompt">%</code> <strong class=
                   13760: "userinput"><code>cvs -d user@cvs.NetBSD.org:/cvsroot export -D today pkgsrc/category/package</code></strong>
1.1       grant    13761: </pre>
                   13762: 
                   13763:                 <p>and use that for further work.</p>
                   13764:               </li>
                   13765: 
                   13766:               <li>
1.14      xtraeme  13767:                 <p>Fix <code class="varname">CATEGORIES</code> and
                   13768:                 any <code class="varname">DEPENDS</code> paths that
                   13769:                 just did &#8220;<span class=
1.1       grant    13770:                 "quote">../package</span>&#8221; instead of
                   13771:                 &#8220;<span class=
                   13772:                 "quote">../../category/package</span>&#8221;.</p>
                   13773:               </li>
                   13774: 
                   13775:               <li>
1.14      xtraeme  13776:                 <p><span><strong class="command">cvs
                   13777:                 import</strong></span> the modified package in the
                   13778:                 new place.</p>
1.1       grant    13779:               </li>
                   13780: 
                   13781:               <li>
                   13782:                 <p>Check if any package depends on it:</p>
                   13783:                 <pre class="screen">
1.14      xtraeme  13784: <code class="prompt">%</code> <strong class=
                   13785: "userinput"><code>cd /usr/pkgsrc</code></strong>
                   13786: <code class="prompt">%</code> <strong class=
                   13787: "userinput"><code>grep /package */*/Makefile* */*/buildlink*</code></strong>
1.1       grant    13788: </pre>
                   13789:               </li>
                   13790: 
                   13791:               <li>
                   13792:                 <p>Fix paths in packages from step 5 to point to
                   13793:                 new location.</p>
                   13794:               </li>
                   13795: 
                   13796:               <li>
1.14      xtraeme  13797:                 <p><span><strong class="command">cvs rm
                   13798:                 (-f)</strong></span> the package at the old
                   13799:                 location.</p>
1.1       grant    13800:               </li>
                   13801: 
                   13802:               <li>
1.45      wiz      13803:                 <p>Remove from <code xmlns=
                   13804:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13805:                 "filename">oldcategory/Makefile</code>.</p>
1.1       grant    13806:               </li>
                   13807: 
                   13808:               <li>
1.45      wiz      13809:                 <p>Add to <code xmlns=
                   13810:                 "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  13811:                 "filename">newcategory/Makefile</code>.</p>
1.1       grant    13812:               </li>
                   13813: 
                   13814:               <li>
                   13815:                 <p>Commit the changed and removed files:</p>
                   13816:                 <pre class="screen">
1.14      xtraeme  13817: <code class="prompt">%</code> <strong class=
                   13818: "userinput"><code>cvs commit oldcategory/package oldcategory/Makefile newcategory/Makefile</code></strong>
1.1       grant    13819: </pre>
                   13820: 
                   13821:                 <p>(and any packages from step 5, of course).</p>
                   13822:               </li>
                   13823:             </ol>
                   13824:           </div>
                   13825:         </div>
                   13826:       </div>
                   13827:     </div>
                   13828: 
1.52      tv       13829:     <div class="appendix" lang="en">
1.1       grant    13830:       <div class="titlepage">
                   13831:         <div>
                   13832:           <div>
1.52      tv       13833:             <h2 class="title"><a name=
1.46      gdt      13834:             "examples"></a>Appendix&nbsp;A.&nbsp;A simple example
1.1       grant    13835:             package: bison</h2>
                   13836:           </div>
                   13837:         </div>
                   13838:       </div>
                   13839: 
                   13840:       <div class="toc">
                   13841:         <p><b>Table of Contents</b></p>
                   13842: 
                   13843:         <dl>
1.46      gdt      13844:           <dt><span class="sect1"><a href="#example-files">A.1.
1.1       grant    13845:           files</a></span></dt>
                   13846: 
                   13847:           <dd>
                   13848:             <dl>
1.30      wiz      13849:               <dt><span class="sect2"><a href=
1.46      gdt      13850:               "#example-Makefile">A.1.1. Makefile</a></span></dt>
1.1       grant    13851: 
1.30      wiz      13852:               <dt><span class="sect2"><a href=
1.46      gdt      13853:               "#example-descr">A.1.2. DESCR</a></span></dt>
1.1       grant    13854: 
1.30      wiz      13855:               <dt><span class="sect2"><a href=
1.46      gdt      13856:               "#example-plist">A.1.3. PLIST</a></span></dt>
1.1       grant    13857: 
1.30      wiz      13858:               <dt><span class="sect2"><a href=
1.46      gdt      13859:               "#checking-package-with-pkglint">A.1.4. Checking a
1.30      wiz      13860:               package with <span><strong class=
1.14      xtraeme  13861:               "command">pkglint</strong></span></a></span></dt>
1.1       grant    13862:             </dl>
                   13863:           </dd>
                   13864: 
1.46      gdt      13865:           <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2.
1.30      wiz      13866:           Steps for building, installing, packaging</a></span></dt>
1.1       grant    13867:         </dl>
                   13868:       </div>
                   13869: 
                   13870:       <p>We checked to find a piece of software that wasn't in the
                   13871:       packages collection, and picked GNU bison. Quite why someone
1.14      xtraeme  13872:       would want to have <span><strong class=
                   13873:       "command">bison</strong></span> when Berkeley
                   13874:       <span><strong class="command">yacc</strong></span> is already
                   13875:       present in the tree is beyond us, but it's useful for the
                   13876:       purposes of this exercise.</p>
1.1       grant    13877: 
1.52      tv       13878:       <div class="sect1" lang="en">
1.1       grant    13879:         <div class="titlepage">
                   13880:           <div>
                   13881:             <div>
                   13882:               <h2 class="title" style="clear: both"><a name=
1.46      gdt      13883:               "example-files"></a>A.1.&nbsp;files</h2>
1.1       grant    13884:             </div>
                   13885:           </div>
                   13886:         </div>
                   13887: 
1.52      tv       13888:         <div class="sect2" lang="en">
1.1       grant    13889:           <div class="titlepage">
                   13890:             <div>
                   13891:               <div>
1.52      tv       13892:                 <h3 class="title"><a name=
1.46      gdt      13893:                 "example-Makefile"></a>A.1.1.&nbsp;Makefile</h3>
1.1       grant    13894:               </div>
                   13895:             </div>
                   13896:           </div>
                   13897:           <pre class="programlisting">
1.51      rillig   13898:     # $NetBSD$
                   13899:     #
1.1       grant    13900: 
1.51      rillig   13901:     DISTNAME=       bison-1.25
                   13902:     CATEGORIES=     devel
                   13903:     MASTER_SITES=   ${MASTER_SITE_GNU}
1.1       grant    13904: 
1.51      rillig   13905:     MAINTAINER=     thorpej@NetBSD.org
                   13906:     HOMEPAGE=       http://www.gnu.org/software/bison/bison.html
                   13907:     COMMENT=        GNU yacc clone
1.1       grant    13908: 
1.51      rillig   13909:     GNU_CONFIGURE=  yes
                   13910:     INFO_FILES=     bison.info
1.1       grant    13911: 
1.51      rillig   13912:     .include "../../mk/bsd.pkg.mk"
1.1       grant    13913: </pre>
                   13914:         </div>
                   13915: 
1.52      tv       13916:         <div class="sect2" lang="en">
1.1       grant    13917:           <div class="titlepage">
                   13918:             <div>
                   13919:               <div>
1.52      tv       13920:                 <h3 class="title"><a name=
1.46      gdt      13921:                 "example-descr"></a>A.1.2.&nbsp;DESCR</h3>
1.1       grant    13922:               </div>
                   13923:             </div>
                   13924:           </div>
                   13925:           <pre class="programlisting">
1.51      rillig   13926:     GNU version of yacc.  Can make re-entrant parsers, and numerous other
                   13927:     improvements.  Why you would want this when Berkeley <a href=
1.1       grant    13928: "http://netbsd.gw.com/cgi-bin/man-cgi?yacc+1+NetBSD-current"><span class="citerefentry"><span class="refentrytitle">yacc</span>(1)</span></a> is part
1.51      rillig   13929:     of the NetBSD source tree is beyond me.
1.1       grant    13930: </pre>
                   13931:         </div>
                   13932: 
1.52      tv       13933:         <div class="sect2" lang="en">
1.1       grant    13934:           <div class="titlepage">
                   13935:             <div>
                   13936:               <div>
1.52      tv       13937:                 <h3 class="title"><a name=
1.46      gdt      13938:                 "example-plist"></a>A.1.3.&nbsp;PLIST</h3>
1.1       grant    13939:               </div>
                   13940:             </div>
                   13941:           </div>
                   13942:           <pre class="programlisting">
1.51      rillig   13943:     @comment $NetBSD$
                   13944:     bin/bison
                   13945:     man/man1/bison.1.gz
                   13946:     share/bison.simple
                   13947:     share/bison.hairy
1.1       grant    13948: </pre>
                   13949:         </div>
                   13950: 
1.52      tv       13951:         <div class="sect2" lang="en">
1.1       grant    13952:           <div class="titlepage">
                   13953:             <div>
                   13954:               <div>
1.30      wiz      13955:                 <h3 class="title"><a name=
1.46      gdt      13956:                 "checking-package-with-pkglint"></a>A.1.4.&nbsp;Checking
1.30      wiz      13957:                 a package with <span><strong class=
1.14      xtraeme  13958:                 "command">pkglint</strong></span></h3>
1.1       grant    13959:               </div>
                   13960:             </div>
                   13961:           </div>
                   13962: 
                   13963:           <p>The NetBSD package system comes with <a xmlns=
                   13964:           "http://www.w3.org/TR/xhtml1/transitional" href=
                   13965:           "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkglint/README.html"
1.45      wiz      13966:           target="_top"><code xmlns="" class=
                   13967:           "filename">pkgtools/pkglint</code></a> which helps to
                   13968:           check the contents of these files. After installation it
                   13969:           is quite easy to use, just change to the directory of the
1.20      ben      13970:           package you wish to examine and execute
                   13971:           <span><strong class=
                   13972:           "command">pkglint</strong></span>:</p>
1.1       grant    13973:           <pre class="screen">
1.14      xtraeme  13974: <code class="prompt">$</code> <strong class=
                   13975: "userinput"><code>pkglint</code></strong>
1.1       grant    13976: looks fine.
                   13977: </pre>
                   13978: 
                   13979:           <p>Depending on the supplied command line arguments (see
1.47      reed     13980:           pkglint(1)), more verbose checks will be performed. Use
1.14      xtraeme  13981:           e.g. <span><strong class="command">pkglint
                   13982:           -v</strong></span> for a very verbose check.</p>
1.1       grant    13983:         </div>
                   13984:       </div>
                   13985: 
1.52      tv       13986:       <div class="sect1" lang="en">
1.1       grant    13987:         <div class="titlepage">
                   13988:           <div>
                   13989:             <div>
                   13990:               <h2 class="title" style="clear: both"><a name=
1.46      gdt      13991:               "steps-for-b-i-p"></a>A.2.&nbsp;Steps for building,
1.30      wiz      13992:               installing, packaging</h2>
1.1       grant    13993:             </div>
                   13994:           </div>
                   13995:         </div>
                   13996: 
                   13997:         <p>Create the directory where the package lives, plus any
                   13998:         auxiliary directories:</p>
                   13999:         <pre class="screen">
1.14      xtraeme  14000: <code class="prompt">#</code> <strong class=
                   14001: "userinput"><code>cd /usr/pkgsrc/lang</code></strong>
                   14002: <code class="prompt">#</code> <strong class=
                   14003: "userinput"><code>mkdir bison</code></strong>
                   14004: <code class="prompt">#</code> <strong class=
                   14005: "userinput"><code>cd bison</code></strong>
                   14006: <code class="prompt">#</code> <strong class=
                   14007: "userinput"><code>mkdir patches</code></strong>
1.1       grant    14008: </pre>
                   14009: 
1.45      wiz      14010:         <p>Create <code xmlns=
                   14011:         "http://www.w3.org/TR/xhtml1/transitional" class=
                   14012:         "filename">Makefile</code>, <code xmlns=
                   14013:         "http://www.w3.org/TR/xhtml1/transitional" class=
                   14014:         "filename">DESCR</code> and <code xmlns=
                   14015:         "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14016:         "filename">PLIST</code> (see <a href="#components" title=
1.38      dillo    14017:         "Chapter&nbsp;8.&nbsp;Package components - files, directories and contents">
1.52      tv       14018:         Chapter&nbsp;8, <i>Package components - files, directories
                   14019:         and contents</i></a>) then continue with fetching the
1.1       grant    14020:         distfile:</p>
                   14021:         <pre class="screen">
1.14      xtraeme  14022: <code class="prompt">#</code> <strong class=
                   14023: "userinput"><code>make fetch</code></strong>
1.1       grant    14024: &gt;&gt; bison-1.25.tar.gz doesn't seem to exist on this system.
                   14025: &gt;&gt; Attempting to fetch from ftp://prep.ai.mit.edu/pub/gnu//.
                   14026: Requesting ftp://prep.ai.mit.edu/pub/gnu//bison-1.25.tar.gz (via ftp://orpheus.amdahl.com:80/)
                   14027: ftp: Error retrieving file: 500 Internal error
                   14028: 
                   14029: &gt;&gt; Attempting to fetch from ftp://wuarchive.wustl.edu/systems/gnu//.
                   14030: Requesting ftp://wuarchive.wustl.edu/systems/gnu//bison-1.25.tar.gz (via ftp://orpheus.amdahl.com:80/)
                   14031: ftp: Error retrieving file: 500 Internal error
                   14032: 
                   14033: &gt;&gt; Attempting to fetch from ftp://ftp.freebsd.org/pub/FreeBSD/distfiles//.
                   14034: Requesting ftp://ftp.freebsd.org/pub/FreeBSD/distfiles//bison-1.25.tar.gz (via ftp://orpheus.amdahl.com:80/)
                   14035: Successfully retrieved file.
                   14036: </pre>
                   14037: 
1.45      wiz      14038:         <p>Generate the checksum of the distfile into <code xmlns=
                   14039:         "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14040:         "filename">distinfo</code>:</p>
1.1       grant    14041:         <pre class="screen">
1.14      xtraeme  14042: <code class="prompt">#</code> <strong class=
                   14043: "userinput"><code>make makesum</code></strong>
1.1       grant    14044: </pre>
                   14045: 
                   14046:         <p>Now compile:</p>
                   14047:         <pre class="screen">
1.14      xtraeme  14048: <code class="prompt">#</code> <strong class=
                   14049: "userinput"><code>make</code></strong>
1.1       grant    14050: &gt;&gt; Checksum OK for bison-1.25.tar.gz.
                   14051: ===&gt;  Extracting for bison-1.25
                   14052: ===&gt;  Patching for bison-1.25
                   14053: ===&gt;   Ignoring empty patch directory
                   14054: ===&gt;  Configuring for bison-1.25
                   14055: creating cache ./config.cache
                   14056: checking for gcc... cc
                   14057: checking whether we are using GNU C... yes
                   14058: checking for a BSD compatible install... /usr/bin/install -c -o bin -g bin
                   14059: checking how to run the C preprocessor... cc -E
                   14060: checking for minix/config.h... no
                   14061: checking for POSIXized ISC... no
                   14062: checking whether cross-compiling... no
                   14063: checking for ANSI C header files... yes
                   14064: checking for string.h... yes
                   14065: checking for stdlib.h... yes
                   14066: checking for memory.h... yes
                   14067: checking for working const... yes
                   14068: checking for working alloca.h... no
                   14069: checking for alloca... yes
                   14070: checking for strerror... yes
                   14071: updating cache ./config.cache
                   14072: creating ./config.status
                   14073: creating Makefile
                   14074: ===&gt;  Building for bison-1.25
                   14075: 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 LR0.c
                   14076: 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 allocate.c
                   14077: 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
                   14078: 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
                   14079: 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
                   14080: 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 
                   14081: 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
                   14082: 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
                   14083: 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
                   14084: 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 lex.c
                   14085: 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 main.c
                   14086: 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 nullable.c
                   14087: 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 output.c
                   14088: 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 print.c
                   14089: 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 reader.c
                   14090: 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 reduce.c
                   14091: 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 symtab.c
                   14092: 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 warshall.c
                   14093: 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 version.c
                   14094: 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 getopt.c
                   14095: 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 getopt1.c
                   14096: cc  -g -o bison LR0.o allocate.o closure.o conflicts.o derives.o files.o         getargs.o gram.o lalr.o lex.o                                   main.o nullable.o output.o print.o reader.o reduce.o symtab.o   warshall.o version.o getopt.o getopt1.o
                   14097: ./files.c:240: warning: mktemp() possibly used unsafely, consider using mkstemp()
                   14098: rm -f bison.s1
                   14099: sed -e "/^#line/ s|bison|/usr/pkg/share/bison|" &lt; ./bison.simple &gt; bison.s1
                   14100: </pre>
                   14101: 
                   14102:         <p>Everything seems OK, so install the files:</p>
                   14103:         <pre class="screen">
1.14      xtraeme  14104: <code class="prompt">#</code> <strong class=
                   14105: "userinput"><code>make install</code></strong>
1.1       grant    14106: &gt;&gt; Checksum OK for bison-1.25.tar.gz.
                   14107: ===&gt;  Installing for bison-1.25
                   14108: sh ./mkinstalldirs /usr/pkg/bin /usr/pkg/share  /usr/pkg/info /usr/pkg/man/man1
                   14109: rm -f /usr/pkg/bin/bison
                   14110: cd /usr/pkg/share; rm -f bison.simple bison.hairy
                   14111: rm -f /usr/pkg/man/man1/bison.1 /usr/pkg/info/bison.info*
                   14112: install -c  -o bin -g bin -m 555 bison /usr/pkg/bin/bison
                   14113: /usr/bin/install -c -o bin -g bin -m 644 bison.s1 /usr/pkg/share/bison.simple
                   14114: /usr/bin/install -c -o bin -g bin -m 644 ./bison.hairy /usr/pkg/share/bison.hairy
                   14115: cd .; for f in bison.info*;  do /usr/bin/install -c -o bin -g bin -m 644 $f /usr/pkg/info/$f; done
                   14116: /usr/bin/install -c -o bin -g bin -m 644 ./bison.1 /usr/pkg/man/man1/bison.1
                   14117: ===&gt;  Registering installation for bison-1.25
                   14118: </pre>
                   14119: 
                   14120:         <p>You can now use bison, and also - if you decide so -
1.14      xtraeme  14121:         remove it with <span><strong class="command">pkg_delete
                   14122:         bison</strong></span>. Should you decide that you want a
                   14123:         binary package, do this now:</p>
1.1       grant    14124:         <pre class="screen">
1.14      xtraeme  14125: <code class="prompt">#</code> <strong class=
                   14126: "userinput"><code>make package</code></strong>
1.1       grant    14127: &gt;&gt; Checksum OK for bison-1.25.tar.gz.
                   14128: ===&gt;  Building package for bison-1.25
                   14129: Creating package bison-1.25.tgz
                   14130: Registering depends:.
                   14131: Creating gzip'd tar ball in '/u/pkgsrc/lang/bison/bison-1.25.tgz'
                   14132: </pre>
                   14133: 
                   14134:         <p>Now that you don't need the source and object files any
                   14135:         more, clean up:</p>
                   14136:         <pre class="screen">
1.14      xtraeme  14137: <code class="prompt">#</code> <strong class=
                   14138: "userinput"><code>make clean</code></strong>
1.1       grant    14139: ===&gt;  Cleaning for bison-1.25
                   14140: </pre>
                   14141:       </div>
                   14142:     </div>
                   14143: 
1.52      tv       14144:     <div class="appendix" lang="en">
1.1       grant    14145:       <div class="titlepage">
                   14146:         <div>
                   14147:           <div>
1.52      tv       14148:             <h2 class="title"><a name=
1.46      gdt      14149:             "logs"></a>Appendix&nbsp;B.&nbsp;Build logs</h2>
1.1       grant    14150:           </div>
                   14151:         </div>
                   14152:       </div>
                   14153: 
                   14154:       <div class="toc">
                   14155:         <p><b>Table of Contents</b></p>
                   14156: 
                   14157:         <dl>
1.46      gdt      14158:           <dt><span class="sect1"><a href="#logs.building">B.1.
1.1       grant    14159:           Building figlet</a></span></dt>
                   14160: 
1.46      gdt      14161:           <dt><span class="sect1"><a href="#logs.package">B.2.
1.1       grant    14162:           Packaging figlet</a></span></dt>
                   14163:         </dl>
                   14164:       </div>
                   14165: 
1.52      tv       14166:       <div class="sect1" lang="en">
1.1       grant    14167:         <div class="titlepage">
                   14168:           <div>
                   14169:             <div>
                   14170:               <h2 class="title" style="clear: both"><a name=
1.46      gdt      14171:               "logs.building"></a>B.1.&nbsp;Building figlet</h2>
1.1       grant    14172:             </div>
                   14173:           </div>
                   14174:         </div>
                   14175:         <pre class="screen">
1.14      xtraeme  14176: <code class="prompt">#</code> <strong class=
                   14177: "userinput"><code>make</code></strong>
1.1       grant    14178: ===&gt; Checking for vulnerabilities in figlet-2.2.1nb2
                   14179: =&gt; figlet221.tar.gz doesn't seem to exist on this system.
                   14180: =&gt; Attempting to fetch figlet221.tar.gz from ftp://ftp.figlet.org/pub/figlet/program/unix/.
                   14181: =&gt; [172219 bytes]
                   14182: Connected to ftp.plig.net.
                   14183: 220 ftp.plig.org NcFTPd Server (licensed copy) ready.
                   14184: 331 Guest login ok, send your complete e-mail address as password.
                   14185: 230-You are user #5 of 500 simultaneous users allowed.
                   14186: 230-
                   14187: 230-  ___ _             _ _                   
                   14188: 230- |  _| |_ ___   ___| |_|___   ___ ___ ___ 
                   14189: 230- |  _|  _| . |_| . | | | . |_| . |  _| . |
                   14190: 230- |_| |_| |  _|_|  _|_|_|_  |_|___|_| |_  |
                   14191: 230-         |_|   |_|     |___|         |___|
                   14192: 230-
                   14193: 230-** Welcome to ftp.plig.org **
                   14194: 230-
                   14195: 230-Please note that all transfers from this FTP site are logged. If you
                   14196: 230-do not like this, please disconnect now.
                   14197: 230-
                   14198: 230-This arhive is available via
                   14199: 230-
                   14200: 230-HTTP:  http://ftp.plig.org/
                   14201: 230-FTP:   ftp://ftp.plig.org/     (max 500 connections)
                   14202: 230-RSYNC: rsync://ftp.plig.org/   (max  30 connections)
                   14203: 230-
                   14204: 230-Please email comments, bug reports and requests for packages to be
                   14205: 230-mirrored to ftp-admin@plig.org.   
                   14206: 230-
                   14207: 230-
                   14208: 230 Logged in anonymously.
                   14209: Remote system type is UNIX.
                   14210: Using binary mode to transfer files.
                   14211: 200 Type okay.
                   14212: 250 "/pub" is new cwd.
                   14213: 250-"/pub/figlet" is new cwd.
                   14214: 250-
                   14215: 250-Welcome to the figlet archive at ftp.figlet.org
                   14216: 250-    
                   14217: 250-    ftp://ftp.figlet.org/pub/figlet/
                   14218: 250-
                   14219: 250-The official FIGlet web page is:
                   14220: 250-    http://www.figlet.org/
                   14221: 250-
                   14222: 250-If you have questions, please mailto:info@figlet.org. If you want to
                   14223: 250-contribute a font or something else, you can email us.
                   14224: 250 
                   14225: 250 "/pub/figlet/program" is new cwd.
                   14226: 250 "/pub/figlet/program/unix" is new cwd.
                   14227: local: figlet221.tar.gz remote: figlet221.tar.gz
                   14228: 502 Unimplemented command.
                   14229: 227 Entering Passive Mode (195,40,6,41,246,104)
                   14230: 150 Data connection accepted from 84.128.86.72:65131; transfer starting for figlet221.tar.gz (172219 bytes).
                   14231: 38% |**************                       | 65800      64.16 KB/s    00:01 ETA
                   14232: 226 Transfer completed.
                   14233: 172219 bytes received in 00:02 (75.99 KB/s)
                   14234: 221 Goodbye.
                   14235: =&gt; Checksum OK for figlet221.tar.gz.
                   14236: ===&gt; Extracting for figlet-2.2.1nb2
                   14237: ===&gt; Required installed package ccache-[0-9]*: ccache-2.3nb1 found
                   14238: ===&gt; Patching for figlet-2.2.1nb2
                   14239: ===&gt; Applying pkgsrc patches for figlet-2.2.1nb2
                   14240: ===&gt; Overriding tools for figlet-2.2.1nb2
                   14241: ===&gt; Creating toolchain wrappers for figlet-2.2.1nb2
                   14242: ===&gt; Configuring for figlet-2.2.1nb2
                   14243: ===&gt; Building for figlet-2.2.1nb2
                   14244: gcc -O2 -DDEFAULTFONTDIR=\"/usr/pkg/share/figlet\"  -DDEFAULTFONTFILE=\"standard.flf\"  figlet.c zipio.c crc.c inflate.c -o figlet
                   14245: chmod a+x figlet
                   14246: gcc -O2 -o chkfont chkfont.c
                   14247: =&gt; Unwrapping files-to-be-installed.
1.14      xtraeme  14248: <code class="prompt">#</code>
                   14249: <code class="prompt">#</code> <strong class=
                   14250: "userinput"><code>make install</code></strong>
1.1       grant    14251: ===&gt; Checking for vulnerabilities in figlet-2.2.1nb2
                   14252: ===&gt; Installing for figlet-2.2.1nb2
                   14253: install -d -o root -g wheel -m 755 /usr/pkg/bin
                   14254: install -d -o root -g wheel -m 755 /usr/pkg/man/man6
                   14255: mkdir -p /usr/pkg/share/figlet
                   14256: cp figlet /usr/pkg/bin
                   14257: cp chkfont /usr/pkg/bin
                   14258: chmod 555 figlist showfigfonts
                   14259: cp figlist /usr/pkg/bin
                   14260: cp showfigfonts /usr/pkg/bin
                   14261: cp fonts/*.flf /usr/pkg/share/figlet
                   14262: cp fonts/*.flc /usr/pkg/share/figlet
                   14263: cp figlet.6 /usr/pkg/man/man6
                   14264: ===&gt; Registering installation for figlet-2.2.1nb2
1.14      xtraeme  14265: <code class="prompt">#</code>
1.1       grant    14266: </pre>
                   14267:       </div>
                   14268: 
1.52      tv       14269:       <div class="sect1" lang="en">
1.1       grant    14270:         <div class="titlepage">
                   14271:           <div>
                   14272:             <div>
                   14273:               <h2 class="title" style="clear: both"><a name=
1.46      gdt      14274:               "logs.package"></a>B.2.&nbsp;Packaging figlet</h2>
1.1       grant    14275:             </div>
                   14276:           </div>
                   14277:         </div>
                   14278:         <pre class="screen">
1.14      xtraeme  14279: <code class="prompt">#</code> <strong class=
                   14280: "userinput"><code>make package</code></strong>
1.1       grant    14281: ===&gt; Checking for vulnerabilities in figlet-2.2.1nb2
                   14282: ===&gt; Packaging figlet-2.2.1nb2
                   14283: ===&gt; Building binary package for figlet-2.2.1nb2
                   14284: Creating package /home/cvs/pkgsrc/packages/i386/All/figlet-2.2.1nb2.tgz
                   14285: Using SrcDir value of /usr/pkg
                   14286: Registering depends:.  
1.14      xtraeme  14287: <code class="prompt">#</code>
1.1       grant    14288: </pre>
                   14289:       </div>
                   14290:     </div>
                   14291: 
1.52      tv       14292:     <div class="appendix" lang="en">
1.1       grant    14293:       <div class="titlepage">
                   14294:         <div>
                   14295:           <div>
1.52      tv       14296:             <h2 class="title"><a name=
1.46      gdt      14297:             "ftp-layout"></a>Appendix&nbsp;C.&nbsp;Layout of the
1.1       grant    14298:             FTP server's package archive</h2>
                   14299:           </div>
                   14300:         </div>
                   14301:       </div>
                   14302: 
                   14303:       <p>Layout for precompiled binary packages on
                   14304:       ftp.NetBSD.org:</p>
                   14305:       <pre class="programlisting">
1.51      rillig   14306:     /pub/NetBSD/packages/
                   14307:         distfiles/
1.1       grant    14308: 
1.51      rillig   14309:         # Unpacked pkgsrc trees
                   14310:         pkgsrc-current -&gt; /pub/NetBSD/NetBSD-current/pkgsrc
                   14311:         pkgsrc-2003Q4 -&gt; N/A
                   14312:         pkgsrc-2004Q1/pkgsrc
                   14313: 
                   14314:         # pkgsrc archives
                   14315:         pkgsrc-current.tar.gz -&gt; ../NetBSD-current/tar_files/pkgsrc.tar.gz
                   14316:         pkgsrc-2003Q4.tar.gz -&gt; N/A
                   14317:         pkgsrc-2004Q1.tar.gz -&gt; N/A
                   14318: 
                   14319:         # Per pkgsrc-release/OS-release/arch package archives
                   14320:         pkgsrc-2003Q4/
                   14321:             NetBSD-1.6.2/
                   14322:                 i386/
                   14323:                     All/
                   14324:                     archivers/
                   14325:                         foo -&gt; ../All/foo
                   14326:                     ...
                   14327:         pkgsrc-2004Q1/
                   14328:             NetBSD-1.6.2/
                   14329:                 i386/
                   14330:                     All/
                   14331:                     ...
                   14332:             NetBSD-2.0/
                   14333:                 i386/
                   14334:                     All/
                   14335:                     ...
                   14336:             SunOS-5.9/
                   14337:                 sparc/
                   14338:                     All/
                   14339:                     ...
                   14340:                 x86/
                   14341:                     All/
                   14342:                     ...
                   14343: 
                   14344:         # Per os-release package archive convenience links
                   14345:         NetBSD-1.6.2 -&gt; 1.6.2
                   14346:         1.6.2/
                   14347:             i386 -&gt; ../pkgsrc-2004Q1/NetBSD-1.6.2/i386
                   14348:             m68k/
                   14349:                 All/
                   14350:                 archivers/
                   14351:                     foo -&gt; ../All/foo
                   14352:                 ...
                   14353:             amiga -&gt; m68k
                   14354:             atari -&gt; m68k
                   14355:             ...
                   14356: 
                   14357:         2.0 -&gt; NetBSD-2.0       # backward compat, historic
                   14358:         NetBSD-2.0/
                   14359:             i386 -&gt; ../pkgsrc-2004Q1/NetBSD-2.0/i386
                   14360:         SunOS-5.9/
                   14361:             sparc -&gt; ../pkgsrc-2004Q1/SunOS-5.9/sparc
                   14362:             x86 -&gt; ../pkgsrc-2004Q1/SunOS-5.9/x86
1.1       grant    14363: </pre>
                   14364: 
                   14365:       <p>To create:</p>
                   14366: 
                   14367:       <div class="orderedlist">
                   14368:         <ol type="1">
                   14369:           <li>
                   14370:             <p>Run bulk build, see <a href="#bulkbuild" title=
1.52      tv       14371:             "6.3.&nbsp;Doing a bulk build of all packages">Section&nbsp;6.3,
                   14372:             &#8220;Doing a bulk build of all
1.1       grant    14373:             packages&#8221;</a></p>
                   14374:           </li>
                   14375: 
                   14376:           <li>
                   14377:             <p>Upload /usr/pkgsrc/packages to</p>
                   14378:             <pre class="programlisting">
                   14379:     ftp://ftp.NetBSD.org/pub/NetBSD/packages/\
1.51      rillig   14380:         pkgsrc-2004Q4/\             # pkgsrc-branch
                   14381:         `uname -s`-`uname -r`/\     # OS &amp; version
                   14382:         `uname -p`                  # architecture
1.1       grant    14383: </pre>
                   14384:           </li>
                   14385: 
                   14386:           <li>
1.14      xtraeme  14387:             <p>If necessary, create a symlink <span><strong class=
                   14388:             "command">ln -s `uname -m` `uname -p`</strong></span>
                   14389:             (amiga -&gt; m68k, ...)</p>
1.1       grant    14390:           </li>
                   14391:         </ol>
                   14392:       </div>
                   14393:     </div>
1.2       hubertf  14394: 
1.52      tv       14395:     <div class="appendix" lang="en">
1.2       hubertf  14396:       <div class="titlepage">
                   14397:         <div>
                   14398:           <div>
1.52      tv       14399:             <h2 class="title"><a name=
1.46      gdt      14400:             "editing"></a>Appendix&nbsp;D.&nbsp;Editing guidelines
1.2       hubertf  14401:             for the pkgsrc guide</h2>
                   14402:           </div>
                   14403:         </div>
                   14404:       </div>
                   14405: 
                   14406:       <div class="toc">
                   14407:         <p><b>Table of Contents</b></p>
                   14408: 
                   14409:         <dl>
1.46      gdt      14410:           <dt><span class="sect1"><a href="#targets">D.1.
1.2       hubertf  14411:           Targets</a></span></dt>
                   14412: 
1.46      gdt      14413:           <dt><span class="sect1"><a href="#procedure">D.2.
1.2       hubertf  14414:           Procedure</a></span></dt>
                   14415:         </dl>
                   14416:       </div>
                   14417: 
                   14418:       <p>This section contains information on editing the pkgsrc
                   14419:       guide itself.</p>
                   14420: 
1.52      tv       14421:       <div class="sect1" lang="en">
1.2       hubertf  14422:         <div class="titlepage">
                   14423:           <div>
                   14424:             <div>
                   14425:               <h2 class="title" style="clear: both"><a name=
1.52      tv       14426:               "targets"></a>D.1.&nbsp;Targets</h2>
1.2       hubertf  14427:             </div>
                   14428:           </div>
                   14429:         </div>
                   14430: 
1.45      wiz      14431:         <p>The pkgsrc guide's source code is stored in <code xmlns=
                   14432:         "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14433:         "filename">pkgsrc/doc/guide/files</code>, and several files
1.2       hubertf  14434:         are created from it:</p>
                   14435: 
                   14436:         <div class="itemizedlist">
                   14437:           <ul type="disc">
                   14438:             <li>
1.45      wiz      14439:               <p><code xmlns=
                   14440:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.23      wiz      14441:               "filename">pkgsrc/doc/pkgsrc.txt</code></p>
1.2       hubertf  14442:             </li>
                   14443: 
                   14444:             <li>
1.45      wiz      14445:               <p><code xmlns=
                   14446:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14447:               "filename">pkgsrc/doc/pkgsrc.html</code></p>
1.2       hubertf  14448:             </li>
                   14449: 
                   14450:             <li>
1.45      wiz      14451:               <p><code xmlns=
                   14452:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14453:               "filename">http://www.NetBSD.org/Documentation/pkgsrc/</code>:
1.2       hubertf  14454:               the documentation on the NetBSD website will be built
                   14455:               from pkgsrc and kept up to date on the web server
                   14456:               itself. This means you <span class=
                   14457:               "emphasis"><em>must</em></span> make sure that your
                   14458:               changes haven't broken the build!</p>
                   14459:             </li>
1.6       hubertf  14460: 
                   14461:             <li>
1.45      wiz      14462:               <p><code xmlns=
                   14463:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14464:               "filename">http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.pdf</code>:
1.6       hubertf  14465:               PDF version of the pkgsrc guide.</p>
                   14466:             </li>
                   14467: 
                   14468:             <li>
1.45      wiz      14469:               <p><code xmlns=
                   14470:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14471:               "filename">http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.ps</code>:
1.6       hubertf  14472:               PostScript version of the pkgsrc guide.</p>
                   14473:             </li>
1.2       hubertf  14474:           </ul>
                   14475:         </div>
                   14476:       </div>
                   14477: 
1.52      tv       14478:       <div class="sect1" lang="en">
1.2       hubertf  14479:         <div class="titlepage">
                   14480:           <div>
                   14481:             <div>
                   14482:               <h2 class="title" style="clear: both"><a name=
1.46      gdt      14483:               "procedure"></a>D.2.&nbsp;Procedure</h2>
1.2       hubertf  14484:             </div>
                   14485:           </div>
                   14486:         </div>
                   14487: 
                   14488:         <p>The procedure to edit the pkgsrc guide is:</p>
                   14489: 
                   14490:         <div class="itemizedlist">
                   14491:           <ul type="disc">
                   14492:             <li>
1.6       hubertf  14493:               <p>Make sure you have the packages needed to
                   14494:               re-generate the pkgsrc guide (and other XML-based
                   14495:               NetBSD documentation) installed. These are
1.11      ben      14496:               &#8220;<span class="quote">netbsd-doc</span>&#8221;
1.47      reed     14497:               for creating the ASCII and HTML versions, and
1.6       hubertf  14498:               &#8220;<span class=
1.47      reed     14499:               "quote">netbsd-doc-print</span>&#8221; for the
                   14500:               PostScript and PDF versions. You will need both
1.6       hubertf  14501:               packages installed, to make sure documentation is
                   14502:               consistent across all formats. The packages can be
1.45      wiz      14503:               found in <code xmlns=
                   14504:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14505:               "filename">pkgsrc/meta-pkgs/netbsd-doc</code> and
1.45      wiz      14506:               <code xmlns=
                   14507:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14508:               "filename">pkgsrc/meta-pkgs/netbsd-doc-print</code>.</p>
1.6       hubertf  14509:             </li>
                   14510: 
                   14511:             <li>
1.45      wiz      14512:               <p>Edit the XML file(s) in <code xmlns=
                   14513:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14514:               "filename">pkgsrc/doc/guide/files</code>.</p>
1.2       hubertf  14515:             </li>
                   14516: 
                   14517:             <li>
1.14      xtraeme  14518:               <p>Run <span><strong class="command">make extract
                   14519:               &amp;&amp; make do-lint</strong></span> in
1.45      wiz      14520:               <code xmlns=
                   14521:               "http://www.w3.org/TR/xhtml1/transitional" class=
                   14522:               "filename">pkgsrc/doc/guide</code> to check the XML
                   14523:               syntax, and fix it if needed.</p>
1.4       hubertf  14524:             </li>
                   14525: 
                   14526:             <li>
1.14      xtraeme  14527:               <p>Run <span><strong class=
1.45      wiz      14528:               "command">make</strong></span> in <code xmlns=
                   14529:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14530:               "filename">pkgsrc/doc/guide</code> to build the HTML
                   14531:               and ASCII version.</p>
1.2       hubertf  14532:             </li>
                   14533: 
                   14534:             <li>
1.14      xtraeme  14535:               <p>If all is well, run <span><strong class=
                   14536:               "command">make install-doc</strong></span> to put the
1.45      wiz      14537:               generated files into <code xmlns=
                   14538:               "http://www.w3.org/TR/xhtml1/transitional" class=
1.14      xtraeme  14539:               "filename">pkgsrc/doc</code>.</p>
1.2       hubertf  14540:             </li>
                   14541: 
                   14542:             <li>
1.14      xtraeme  14543:               <p><span><strong class="command">cvs commit
                   14544:               pkgsrc/doc/guide/files</strong></span></p>
1.2       hubertf  14545:             </li>
                   14546: 
                   14547:             <li>
1.14      xtraeme  14548:               <p><span><strong class="command">cvs commit -m
                   14549:               re-generate
                   14550:               pkgsrc/doc/pkgsrc.{html,txt}</strong></span></p>
1.2       hubertf  14551:             </li>
1.4       hubertf  14552: 
                   14553:             <li>
                   14554:               <p>Until the webserver on www.NetBSD.org is really
                   14555:               updated automatically to pick up changes to the
1.14      xtraeme  14556:               pkgsrc guide automatically, also run
1.18      xtraeme  14557:               <span><strong class="command">make install-htdocs
1.14      xtraeme  14558:               HTDOCSDIR=../../../htdocs</strong></span> (or
                   14559:               similar, adjust <code class=
                   14560:               "varname">HTDOCSDIR</code>!).</p>
1.4       hubertf  14561:             </li>
                   14562: 
                   14563:             <li>
1.14      xtraeme  14564:               <p><span><strong class="command">cvs commit
                   14565:               htdocs/Documentation/pkgsrc</strong></span></p>
1.4       hubertf  14566:             </li>
1.2       hubertf  14567:           </ul>
                   14568:         </div>
                   14569:       </div>
                   14570:     </div>
1.1       grant    14571:   </div>
                   14572: </body>
                   14573: </html>

CVSweb <webmaster@jp.NetBSD.org>