diff options
author | wiz <wiz> | 2005-08-03 16:35:14 +0000 |
---|---|---|
committer | wiz <wiz> | 2005-08-03 16:35:14 +0000 |
commit | 108a68e0532a4a427b1676433322334a13c2a4e6 (patch) | |
tree | 9701d146e6a6e4e1c7db85d80a211f0bfd28eda2 /doc/pkgsrc.html | |
parent | 336b04a7348b0b633aa3252c21590a729d7f0a84 (diff) | |
download | pkgsrc-108a68e0532a4a427b1676433322334a13c2a4e6.tar.gz |
regen (more variables documented)
Diffstat (limited to 'doc/pkgsrc.html')
-rw-r--r-- | doc/pkgsrc.html | 3075 |
1 files changed, 2039 insertions, 1036 deletions
diff --git a/doc/pkgsrc.html b/doc/pkgsrc.html index 11213d08a7e..ef1ee87169e 100644 --- a/doc/pkgsrc.html +++ b/doc/pkgsrc.html @@ -108,7 +108,7 @@ alink="#0000FF"> </dl> </dd> - <dt><span class="part"><a href="#users-guide">I. The pkgsrc + <dt><span class="part"><a href="#users-guide">1. The pkgsrc user's guide</a></span></dt> <dd> @@ -227,7 +227,19 @@ alink="#0000FF"> <dd> <dl> <dt><span class="sect1"><a href= - "#selecting-options">5.1. Selecting Build + "#general-configuration">5.1. General + configuration</a></span></dt> + + <dt><span class="sect1"><a href= + "#variables-affecting-build">5.2. Variables + affecting the build process</a></span></dt> + + <dt><span class="sect1"><a href= + "#developer-advanced-settings">5.3. + Developer/advanced settings</a></span></dt> + + <dt><span class="sect1"><a href= + "#selecting-build-options">5.4. Selecting Build Options</a></span></dt> </dl> </dd> @@ -372,7 +384,7 @@ alink="#0000FF"> </dl> </dd> - <dt><span class="part"><a href="#developers-guide">II. The + <dt><span class="part"><a href="#developers-guide">2. The pkgsrc developer's guide</a></span></dt> <dd> @@ -384,11 +396,13 @@ alink="#0000FF"> <dd> <dl> <dt><span class="sect1"><a href= - "#components.Makefile">8.1. <code class= + "#components.Makefile">8.1. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code></a></span></dt> <dt><span class="sect1"><a href= - "#components.distinfo">8.2. <code class= + "#components.distinfo">8.2. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">distinfo</code></a></span></dt> <dt><span class="sect1"><a href= @@ -404,22 +418,27 @@ alink="#0000FF"> files</a></span></dt> <dt><span class="sect1"><a href="#work-dir">8.6. - <code class="filename">work*</code></a></span></dt> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">work*</code></a></span></dt> <dt><span class="sect1"><a href="#files-dir">8.7. - <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">files/*</code></a></span></dt> </dl> </dd> <dt><span class="chapter"><a href="#makefile">9. - Programming in <code class= + Programming in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>s</a></span></dt> <dd> <dl> <dt><span class="sect1"><a href= - "#makefile.variables">9.1. <code class= + "#makefile.variables">9.1. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code> variables</a></span></dt> @@ -471,8 +490,9 @@ alink="#0000FF"> <dt><span class="sect1"><a href= "#automatic-plist-generation">10.2. Semi-automatic - <code class="filename">PLIST</code> - generation</a></span></dt> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code> generation</a></span></dt> <dt><span class="sect1"><a href= "#print-PLIST">10.3. Tweaking output of @@ -512,7 +532,8 @@ alink="#0000FF"> <dt><span class="sect1"><a href= "#creating-buildlink3.mk">11.2. Writing - <code class="filename">buildlink3.mk</code> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">buildlink3.mk</code> files</a></span></dt> <dd> @@ -526,20 +547,25 @@ alink="#0000FF"> <code class= "varname">BUILDLINK_DEPENDS.<em class= "replaceable"><code>pkg</code></em></code> in - <code class="filename">buildlink3.mk</code> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" + class="filename">buildlink3.mk</code> files</a></span></dt> </dl> </dd> <dt><span class="sect1"><a href= - "#writing-builtin.mk">11.3. Writing <code class= + "#writing-builtin.mk">11.3. Writing <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">builtin.mk</code> files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= "#anatomy-of-builtin.mk">11.3.1. Anatomy of a - <code class="filename">builtin.mk</code> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" + class="filename">builtin.mk</code> file</a></span></dt> <dt><span class="sect2"><a href= @@ -639,7 +665,8 @@ alink="#0000FF"> <dt><span class="sect1"><a href= "#converting-to-options">13.2. Converting packages - to use <code class= + to use <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.options.mk</code></a></span></dt> </dl> </dd> @@ -882,63 +909,63 @@ alink="#0000FF"> </dl> </dd> - <dt><span class="appendix"><a href="#examples">A. A simple + <dt><span class="appendix"><a href="#examples">1. A simple example package: bison</a></span></dt> <dd> <dl> - <dt><span class="sect1"><a href="#example-files">A.1. + <dt><span class="sect1"><a href="#example-files">1.1. files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#example-Makefile">A.1.1. Makefile</a></span></dt> + "#example-Makefile">1.1.1. Makefile</a></span></dt> <dt><span class="sect2"><a href= - "#example-descr">A.1.2. DESCR</a></span></dt> + "#example-descr">1.1.2. DESCR</a></span></dt> <dt><span class="sect2"><a href= - "#example-plist">A.1.3. PLIST</a></span></dt> + "#example-plist">1.1.3. PLIST</a></span></dt> <dt><span class="sect2"><a href= - "#checking-package-with-pkglint">A.1.4. Checking a + "#checking-package-with-pkglint">1.1.4. Checking a package with <span><strong class= "command">pkglint</strong></span></a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. + <dt><span class="sect1"><a href="#steps-for-b-i-p">1.2. Steps for building, installing, packaging</a></span></dt> </dl> </dd> - <dt><span class="appendix"><a href="#logs">B. Build + <dt><span class="appendix"><a href="#logs">2. Build logs</a></span></dt> <dd> <dl> - <dt><span class="sect1"><a href="#logs.building">B.1. + <dt><span class="sect1"><a href="#logs.building">2.1. Building figlet</a></span></dt> - <dt><span class="sect1"><a href="#logs.package">B.2. + <dt><span class="sect1"><a href="#logs.package">2.2. Packaging figlet</a></span></dt> </dl> </dd> - <dt><span class="appendix"><a href="#ftp-layout">C. Layout + <dt><span class="appendix"><a href="#ftp-layout">3. Layout of the FTP server's package archive</a></span></dt> - <dt><span class="appendix"><a href="#editing">D. Editing + <dt><span class="appendix"><a href="#editing">4. Editing guidelines for the pkgsrc guide</a></span></dt> <dd> <dl> - <dt><span class="sect1"><a href="#targets">D.1. + <dt><span class="sect1"><a href="#targets">4.1. Targets</a></span></dt> - <dt><span class="sect1"><a href="#procedure">D.2. + <dt><span class="sect1"><a href="#procedure">4.2. Procedure</a></span></dt> </dl> </dd> @@ -1009,7 +1036,8 @@ alink="#0000FF"> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/apache/README.html" - class="pkgname">www/apache</a> - The Apache web + target="_top"><code xmlns="" class= + "filename">www/apache</code></a> - The Apache web server</p> </li> @@ -1017,7 +1045,8 @@ alink="#0000FF"> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/mozilla/README.html" - class="pkgname">www/mozilla</a> - The Mozilla web + target="_top"><code xmlns="" class= + "filename">www/mozilla</code></a> - The Mozilla web browser</p> </li> @@ -1025,7 +1054,8 @@ alink="#0000FF"> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/meta-pkgs/gnome/README.html" - class="pkgname">meta-pkgs/gnome</a> - The GNOME + target="_top"><code xmlns="" class= + "filename">meta-pkgs/gnome</code></a> - The GNOME Desktop Environment</p> </li> @@ -1033,7 +1063,8 @@ alink="#0000FF"> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/meta-pkgs/kde3/README.html" - class="pkgname">meta-pkgs/kde3</a> - The K Desktop + target="_top"><code xmlns="" class= + "filename">meta-pkgs/kde3</code></a> - The K Desktop Environment</p> </li> </ul> @@ -1119,16 +1150,16 @@ alink="#0000FF"> <p>This document is divided into two parts. The first, <a href="#users-guide" title= - "Part I. The pkgsrc user's guide">The pkgsrc + "Part 1. The pkgsrc user's guide">The pkgsrc user's guide</a>, describes how one can use one of the packages in the Package Collection, either by installing a precompiled binary package, or by building one's own copy using the NetBSD package system. The second part, <a href= "#developers-guide" title= - "Part II. The pkgsrc developer's guide">The - pkgsrc developer's guide</a>, explains how to prepare a - package so it can be easily built by other NetBSD users - without knowing about the package's building details.</p> + "Part 2. The pkgsrc developer's guide">The pkgsrc + developer's guide</a>, explains how to prepare a package so + it can be easily built by other NetBSD users without + knowing about the package's building details.</p> <p>This document is available in various formats:</p> @@ -1178,7 +1209,8 @@ alink="#0000FF"> <p>A set of files and building instructions that describe what's necessary to build a certain piece of software using pkgsrc. Packages are traditionally - stored under <code class= + stored under <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgsrc</code>.</p> </dd> @@ -1203,7 +1235,8 @@ alink="#0000FF"> build on NetBSD are reflected in the corresponding package. Usually the distfile is in the form of a compressed tar-archive, but other types are possible, - too. Distfiles are usually stored below <code class= + too. Distfiles are usually stored below <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgsrc/distfiles</code>.</p> </dd> @@ -1223,10 +1256,12 @@ alink="#0000FF"> <dd> <p>A set of binaries built with pkgsrc from a distfile and stuffed together in a single - <code class="filename">.tgz</code> file so it can be + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">.tgz</code> file so it can be installed on machines of the same machine architecture without the need to recompile. Packages - are usually generated in <code class= + are usually generated in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgsrc/packages</code>; there is also an archive on <a href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/" target= @@ -1275,7 +1310,8 @@ alink="#0000FF"> <div> <div> <h1 class="title"><a name="users-guide" id= - "users-guide"></a>The pkgsrc user's guide</h1> + "users-guide"></a>Part 1. The pkgsrc user's + guide</h1> </div> </div> </div> @@ -1397,7 +1433,19 @@ alink="#0000FF"> <dd> <dl> <dt><span class="sect1"><a href= - "#selecting-options">5.1. Selecting Build + "#general-configuration">5.1. General + configuration</a></span></dt> + + <dt><span class="sect1"><a href= + "#variables-affecting-build">5.2. Variables affecting + the build process</a></span></dt> + + <dt><span class="sect1"><a href= + "#developer-advanced-settings">5.3. + Developer/advanced settings</a></span></dt> + + <dt><span class="sect1"><a href= + "#selecting-build-options">5.4. Selecting Build Options</a></span></dt> </dl> </dd> @@ -1586,7 +1634,8 @@ alink="#0000FF"> file from <a href= "ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-current/tar_files/pkgsrc.tar.gz" target="_top">ftp.NetBSD.org</a> and unpack it into - <code class="filename">/usr/pkgsrc</code>.</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/usr/pkgsrc</code>.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -1606,12 +1655,14 @@ alink="#0000FF"> release=pkgsrc </pre> - <p>in it, see the examples in <code class= + <p>in it, see the examples in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/share/examples/supfiles</code>, and that - the <code class="filename">/usr/pkgsrc</code> directory - exists. Then, simply run <span><strong class= - "command">sup -v <em class= - "replaceable"><code>/path/to/your/supfile</code></em></strong></span>.</p> + the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/pkgsrc</code> directory exists. Then, + simply run <span><strong class="command">sup -v + <em class="replaceable"><code>/path/to/your/supfile</code></em></strong></span>.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -1639,10 +1690,13 @@ release=pkgsrc "userinput"><code>cvs checkout -P pkgsrc</code></strong> </pre> - <p>This will create the <code class= - "filename">pkgsrc</code> directory in your <code class= + <p>This will create the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">pkgsrc</code> directory in your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr</code>, and all the package source will - be stored under <code class= + be stored under <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgsrc</code>. To update pkgsrc after the initial checkout, make sure you have <code class= "varname">CVS_RSH</code> set as above, then do:</p> @@ -1785,10 +1839,12 @@ release=pkgsrc <i>Where to get pkgsrc</i></a> for other ways to get pkgsrc before bootstrapping. The given <span><strong class="command">bootstrap</strong></span> - command will use the defaults of <code class= + command will use the defaults of <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkg</code> for the <span class= "emphasis"><em>prefix</em></span> where programs will be - installed in, and <code class= + installed in, and <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/var/db/pkg</code> for the package database directory where pkgsrc will do its internal bookkeeping. However, these can also be set using command-line @@ -1898,11 +1954,15 @@ release=pkgsrc </div> </div> - <p>By default, <code class="filename">/usr</code> - will be on your root file system, normally HFS+. It - is possible to use the default <span class= - "emphasis"><em>prefix</em></span> of <code class= - "filename">/usr/pkg</code> by symlinking <code class= + <p>By default, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr</code> will be on your root file + system, normally HFS+. It is possible to use the + default <span class="emphasis"><em>prefix</em></span> + of <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/pkg</code> by symlinking <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkg</code> to a directory on a UFS file system. Obviously, another symlink is required if you want to place the package database directory @@ -1916,12 +1976,14 @@ release=pkgsrc <p>If you created your partitions at the time of installing Mac OS X and formatted the target partition as UFS, it should automatically mount on - <code class="filename">/Volumes/<volume - name></code> when the machine boots. If you are - (re)formatting a partition as UFS, you need to ensure - that the partition map correctly reflects - “<span class="quote">Apple_UFS</span>” - and not “<span class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/Volumes/<volume name></code> when + the machine boots. If you are (re)formatting a + partition as UFS, you need to ensure that the + partition map correctly reflects “<span class= + "quote">Apple_UFS</span>” and not + “<span class= "quote">Apple_HFS</span>”.</p> <p>The problem is that none of the disk tools will @@ -1969,9 +2031,12 @@ release=pkgsrc <ol type="1"> <li> <p>FreeBSD stores its ports pkg database in - <code class="filename">/var/db/pkg</code>. It is - therefore recommended that you choose a different - location (e.g. <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/var/db/pkg</code>. It is therefore + recommended that you choose a different location + (e.g. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgdb</code>) by using the --pkgdbdir option to the bootstrap script.</p> </li> @@ -1995,9 +2060,11 @@ release=pkgsrc </li> <li> - <p>An example <code class= + <p>An example <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> file will be - placed in <code class= + placed in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf.example</code> file when you use the bootstrap script.</p> </li> @@ -2226,10 +2293,12 @@ interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi: <p>Therefore, please make sure that you have no conflicting <code class="varname">CFLAGS</code> in your - environment or the <code class= + environment or the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code>. Particularly, make sure that you do not try to link n32 object files with lib64 - or vice versa. Check your <code class= + or vice versa. Check your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/compiler.defaults</code>!</p> <p>If you have the actual pkgsrc tree mounted via NFS @@ -2242,7 +2311,8 @@ interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi: <p>The bootstrapping process should set all the right options for programs such as imake(1), but you may want to set some options depending on your local setup. - Please see <code class= + Please see <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/mk/defaults/mk.conf</code> and, of course, your compiler's man pages for details.</p> @@ -2252,10 +2322,13 @@ interix:kP=\E[S:kN=\E[T:kH=\E[U:dc@:DC@:tc=pcansi: PKGSRC_COMPILER=mipspro </pre> - <p>in <code class="filename">/etc/mk.conf</code>. - Otherwise, pkgsrc will assume you are using gcc and may - end up passing invalid flags to the compiler. Note that - bootstrap should create an appropriate <code class= + <p>in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/mk.conf</code>. Otherwise, pkgsrc will + assume you are using gcc and may end up passing invalid + flags to the compiler. Note that bootstrap should + create an appropriate <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">mk.conf.example</code> by default.</p> <p>If you have both the MIPSPro compiler chain @@ -2263,7 +2336,8 @@ PKGSRC_COMPILER=mipspro MIPRPro is used, please set your <code class= "varname">PATH</code> to <span class= "emphasis"><em>not</em></span> include the location of - gcc (often <code class= + gcc (often <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/freeware/bin</code>), and (important) pass the '--preserve-path' flag.</p> </div> @@ -2312,17 +2386,20 @@ env CC=/opt/intel_cc_80/bin/icc LDFLAGS=-static-libcxa \ __attribute__ is assumed supported by the compiler.</p> <p>After bootstrapping, you should set <code class= - "varname">PKGSRC_COMPILER</code> in <code class= + "varname">PKGSRC_COMPILER</code> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code>:</p> <pre class="programlisting"> PKGSRC_COMPILER=icc </pre> <p>The default installation directory for icc is - <code class="filename">/opt/intel_cc_80</code>, which - is also the pkgsrc default. If you have installed it - into a different directory, set <code class= - "varname">ICCBASE</code> in <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/opt/intel_cc_80</code>, which is also + the pkgsrc default. If you have installed it into a + different directory, set <code class= + "varname">ICCBASE</code> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code>:</p> <pre class="programlisting"> ICCBASE=/opt/icc @@ -2366,9 +2443,12 @@ ICCBASE=/opt/icc <ol type="1"> <li> <p>OpenBSD stores its ports pkg database in - <code class="filename">/var/db/pkg</code>. It is - therefore recommended that you choose a different - location (e.g. <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/var/db/pkg</code>. It is therefore + recommended that you choose a different location + (e.g. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgdb</code>) by using the --pkgdbdir option to the bootstrap script.</p> </li> @@ -2392,12 +2472,15 @@ ICCBASE=/opt/icc </li> <li> - <p>An example <code class= + <p>An example <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> file will be - placed in <code class= + placed in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf.example</code> file when you use the bootstrap script. OpenBSD's make - program uses <code class= + program uses <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> as well. You can work around this by enclosing all the pkgsrc specific parts of the file with:</p> @@ -2477,8 +2560,9 @@ ICCBASE=/opt/icc <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/lang/gcc/README.html" - class="pkgname">lang/gcc</a> or install a binary gcc - package, then remove gcc used during + target="_top"><code xmlns="" class= + "filename">lang/gcc</code></a> or install a binary + gcc package, then remove gcc used during bootstrapping.</p> <p>Binary packages of gcc can be found through @@ -2527,7 +2611,8 @@ ICCBASE=/opt/icc <p>You should set <code class="varname">CC</code>, <code class="varname">CXX</code> and optionally, - <code class="varname">CPP</code> in <code class= + <code class="varname">CPP</code> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code>, eg.</p> <pre class="programlisting"> CC= cc @@ -2544,8 +2629,11 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>Whichever compiler you use, please ensure the compiler tools and your $prefix are in your <code class="varname">PATH</code>. This includes - <code class="filename">/usr/ccs/{bin,lib}</code> and - eg. <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/ccs/{bin,lib}</code> and eg. + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkg/{bin,sbin}</code>.</p> </div> </div> @@ -2639,7 +2727,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 </div> <p>Precompiled packages are stored on ftp.NetBSD.org - and its mirrors in the directory <code class= + and its mirrors in the directory <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/pub/NetBSD/packages/<OSVERSION>/<ARCH>/</code> for anonymous FTP access. <code class= "varname">OSVERSION</code> is the NetBSD version @@ -2648,16 +2737,21 @@ CFLAGS= -xtarget=ultra -xarch=v9 is the architecture (<span><strong class= "command">uname -p</strong></span>). In that directory, there is a subdirectory for each category plus a - subdirectory <code class="filename">All</code> which - includes the actual binaries in <code class= + subdirectory <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">All</code> which includes the actual + binaries in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.tgz</code> files. The category subdirectories use symbolic links to those files (this - is the same directory layout as in <code class= + is the same directory layout as in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgsrc/packages</code>).</p> <p>This same directory layout applies for CDROM distributions, only that the directory may be rooted - somewhere else, probably somewhere below <code class= + somewhere else, probably somewhere below <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/cdrom</code>. Please consult your CDROMs documentation for the exact location.</p> </div> @@ -2702,32 +2796,40 @@ CFLAGS= -xtarget=ultra -xarch=v9 semicolon separated list of paths (including remote URLs); trailing slashes are not allowed.</p> - <p>Additionally to the <code class= + <p>Additionally to the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">All</code> directory there exists a - <code class="filename">vulnerable</code> directory to - which binary packages with known vulnerabilities are - moved, since removing them could cause missing - dependencies. To use these packages, add the - <code class="filename">vulnerable</code> directory to - your <code class="varname">PKG_PATH</code>. However, - you should run <a xmlns= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">vulnerable</code> directory to which + binary packages with known vulnerabilities are moved, + since removing them could cause missing dependencies. + To use these packages, add the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">vulnerable</code> directory to your + <code class="varname">PKG_PATH</code>. However, you + should run <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/audit-packages/README.html" - class="pkgname">security/audit-packages</a> regularly, - and especially after installing new packages, and - verify that the vulnerabilities are acceptable for your - configuration. An example <code class= - "varname">PKG_PATH</code> would be: <code class= + target="_top"><code xmlns="" class= + "filename">security/audit-packages</code></a> + regularly, and especially after installing new + packages, and verify that the vulnerabilities are + acceptable for your configuration. An example + <code class="varname">PKG_PATH</code> would be: + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class= "filename">ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/All;ftp://ftp.NetBSD.org/pub/NetBSD/packages/<OSVERSION>/<ARCH>/vulnerable</code> Please note that semicolon (';') is a shell meta-character, so you'll probably have to quote it.</p> <p>After you've installed packages, be sure to have - <code class="filename">/usr/pkg/bin</code> and - <code class="filename">/usr/pkg/sbin</code> in your - <code class="varname">PATH</code> so you can actually - start the just installed program.</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/usr/pkg/bin</code> and <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/pkg/sbin</code> in your <code class= + "varname">PATH</code> so you can actually start the + just installed program.</p> </div> <div class="sect2" lang="en" xml:lang="en"> @@ -2767,7 +2869,7 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>This assumes that the package is already in pkgsrc. If it is not, see <a href="#developers-guide" title= - "Part II. The pkgsrc developer's guide">Part II, + "Part 2. The pkgsrc developer's guide">Part 2, “The pkgsrc developer's guide”</a> for instructions how to create your own packages.</p> @@ -2809,7 +2911,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>You can overwrite some of the major distribution sites to fit to sites that are close to your own. Have - a look at <code class= + a look at <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/mk/defaults/mk.conf</code> to find some examples — in particular, look for the <code class="varname">MASTER_SORT</code>, <code class= @@ -2819,14 +2922,17 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>You can change these settings either in your shell's environment, or, if you want to keep the settings, by - editing the <code class="filename">/etc/mk.conf</code> - file, and adding the definitions there.</p> + editing the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/mk.conf</code> file, and adding the + definitions there.</p> <p>If you don't have a permanent Internet connection and you want to know which files to download, <span><strong class="command">make fetch-list</strong></span> will tell you what you'll - need. Put these distfiles into <code class= + need. Put these distfiles into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgsrc/distfiles</code>.</p> </div> @@ -2870,16 +2976,18 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>Taking the figlet utility as an example, we can install it on our system by building as shown in <a href="#logs" title= - "Appendix B. Build logs">Appendix B, <i>Build + "Appendix 2. Build logs">Appendix 2, <i>Build logs</i></a>.</p> <p>The program is installed under the default root of - the packages tree - <code class= + the packages tree - <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkg</code>. Should this not conform to your tastes, set the <code class= "varname">LOCALBASE</code> variable in your environment, and it will use that value as the root of - your packages tree. So, to use <code class= + your packages tree. So, to use <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/local</code>, set <code class= "varname">LOCALBASE=/usr/local</code> in your environment. Please note that you should use a @@ -2887,23 +2995,28 @@ CFLAGS= -xtarget=ultra -xarch=v9 with other programs (ie, do not try and use <code class="varname">LOCALBASE=/usr</code>). Also, you should not try to add any of your own files or - directories (such as <code class= - "filename">src/</code>, <code class= - "filename">obj/</code>, or <code class= + directories (such as <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">src/</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">obj/</code>, or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/</code>) below the <code class= "varname">LOCALBASE</code> tree. This is to prevent possible conflicts between programs and other files installed by the package system and whatever else may have been installed there.</p> - <p>Some packages look in <code class= + <p>Some packages look in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> to alter some configuration options at build time. Have a look at - <code class= - "filename">pkgsrc/mk/defaults/mk.conf</code> to get an - overview of what will be set there by default. + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">pkgsrc/mk/defaults/mk.conf</code> to + get an overview of what will be set there by default. Environment variables such as <code class= - "varname">LOCALBASE</code> can be set in <code class= + "varname">LOCALBASE</code> can be set in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> to save having to remember to set them each time you want to use pkgsrc.</p> @@ -2981,7 +3094,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 <span class="citerefentry"><span class= "refentrytitle">pkg_add</span>(1)</span></a> can be put into <code class="varname">BIN_INSTALL_FLAGS</code>. - See <code class= + See <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/mk/defaults/mk.conf</code> for more details.</p> @@ -2994,9 +3108,10 @@ CFLAGS= -xtarget=ultra -xarch=v9 installed packages, and fail miserably. Note also that precompiled binary packages are usually built with the default <code class="varname">LOCALBASE</code> of - <code class="filename">/usr/pkg</code>, and that you - should <span class="emphasis"><em>not</em></span> - install any if you use a non-standard <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/usr/pkg</code>, and that you should + <span class="emphasis"><em>not</em></span> install any + if you use a non-standard <code class= "varname">LOCALBASE</code>.</p> </div> @@ -3107,7 +3222,19 @@ CFLAGS= -xtarget=ultra -xarch=v9 <dl> <dt><span class="sect1"><a href= - "#selecting-options">5.1. Selecting Build + "#general-configuration">5.1. General + configuration</a></span></dt> + + <dt><span class="sect1"><a href= + "#variables-affecting-build">5.2. Variables affecting + the build process</a></span></dt> + + <dt><span class="sect1"><a href= + "#developer-advanced-settings">5.3. Developer/advanced + settings</a></span></dt> + + <dt><span class="sect1"><a href= + "#selecting-build-options">5.4. Selecting Build Options</a></span></dt> </dl> </div> @@ -3117,9 +3244,225 @@ CFLAGS= -xtarget=ultra -xarch=v9 <div> <div> <h2 class="title" style="clear: both"><a name= - "selecting-options" id= - "selecting-options"></a>5.1. Selecting Build - Options</h2> + "general-configuration" id= + "general-configuration"></a>5.1. General + configuration</h2> + </div> + </div> + </div> + + <p>In this section you can find some variables that apply + all pkgsrc packages. The preferred method of setting them + is by setting them in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/mk.conf</code>.</p> + + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p><code class="varname">LOCALBASE</code>: Where + packages will be installed. The default is + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/pkg</code>. Do not mix binary + packages with different <code class= + "varname">LOCALBASE</code>s!</p> + </li> + + <li> + <p><code class="varname">CROSSBASE</code>: Where + “<span class="quote">cross</span>” + category packages will be installed. The default is + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${LOCALBASE}/cross</code>.</p> + </li> + + <li> + <p><code class="varname">X11BASE</code>: Where X11 + is installed on the system. The default is + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/X11R6</code>.</p> + </li> + + <li> + <p><code class="varname">DISTDIR</code>: Where to + store the downloaded copies of the original source + distributions used for building pkgsrc packages. + The default is <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${PKGSRCDIR}/distfiles</code>.</p> + </li> + + <li> + <p><code class= + "varname">MASTER_SITE_OVERRIDE</code>: If set, + override the packages' <code class= + "varname">MASTER_SITES</code> with this value.</p> + </li> + + <li> + <p><code class="varname">MASTER_SITE_BACKUP</code>: + Backup location(s) for distribution files and patch + files if not found locally or in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${MASTER_SITES}</code> or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${PATCH_SITES}</code> respectively. The + defaults are <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}/</code> + and <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/</code>.</p> + </li> + + <li> + <p><code class="varname">BINPKG_SITES</code>: List + of sites carrying binary pkgs.</p> + </li> + </ul> + </div> + </div> + + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a name= + "variables-affecting-build" id= + "variables-affecting-build"></a>5.2. Variables + affecting the build process</h2> + </div> + </div> + </div> + + <p>XXX</p> + + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p><code class="varname">PACKAGES</code>: The top + level directory for the binary packages. The + default is <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${PKGSRCDIR}/packages</code>.</p> + </li> + + <li> + <p><code class="varname">WRKOBJDIR</code>: The top + level directory where, if defined, the separate + working directories will get created, and + symbolically linked to from <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${WRKDIR}</code> (see below). This is + useful for building packages on several + architectures, then <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${PKGSRCDIR}</code> can be NFS-mounted + while <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${WRKOBJDIR}</code> is local to every + architecture. (It should be noted that <code class= + "varname">PKGSRCDIR</code> should not be set by the + user — it is an internal definition which + refers to the root of the pkgsrc tree. It is + possible to have many pkgsrc tree instances.)</p> + </li> + + <li> + <p><code class="varname">LOCALPATCHES</code>: + Directory for local patches that aren't part of + pkgsrc. See <a href="#components.patches" title= + "8.3. patches/*">Section 8.3, + “patches/*”</a> for more information. + <em class="replaceable"><code>rel</code></em> and + <em class="replaceable"><code>arch</code></em> are + replaced with OS release (“<span class= + "quote">2.0</span>”, etc.) and architecture + (“<span class="quote">mipsel</span>”, + etc.).</p> + </li> + + <li> + <p><code class="varname">PKGMAKECONF</code>: + Location of the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">mk.conf</code> file used by a package's + BSD-style Makefile. If this is not set, + <code class="varname">MAKECONF</code> is set to + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/dev/null</code> to avoid picking up + settings used by builds in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/src</code>.</p> + </li> + </ul> + </div> + </div> + + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a name= + "developer-advanced-settings" id= + "developer-advanced-settings"></a>5.3. Developer/advanced + settings</h2> + </div> + </div> + </div> + + <p>XXX</p> + + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p><code class="varname">PKG_DEVELOPER</code>: Run + some sanity checks that package developers + want:</p> + + <div class="itemizedlist"> + <ul type="circle"> + <li> + <p>make sure patches apply with zero fuzz</p> + </li> + + <li> + <p>run check-shlibs to see that all binaries + will find their shared libs.</p> + </li> + </ul> + </div> + </li> + + <li> + <p><code class="varname">PKG_DEBUG_LEVEL</code>: + The level of debugging output which is displayed + whilst making and installing the package. The + default value for this is 0, which will not display + the commands as they are executed (normal, default, + quiet operation); the value 1 will display all + shell commands before their invocation, and the + value 2 will display both the shell commands before + their invocation, and their actual execution + progress with <span><strong class="command">set + -x</strong></span> will be displayed.</p> + </li> + </ul> + </div> + </div> + + <div class="sect1" lang="en" xml:lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a name= + "selecting-build-options" id= + "selecting-build-options"></a>5.4. Selecting + Build Options</h2> </div> </div> </div> @@ -3148,7 +3491,8 @@ CFLAGS= -xtarget=ultra -xarch=v9 </pre> - <p>The following variables can be defined in <code class= + <p>The following variables can be defined in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> to select which options to enable for a package: <code class= "varname">PKG_DEFAULT_OPTIONS</code>, which can be used @@ -3201,11 +3545,13 @@ CFLAGS= -xtarget=ultra -xarch=v9 <p>Before the options framework was introduced, build options were selected by setting a variable in - <code class="filename">/etc/mk.conf</code> for each - option. To ease transition to the options framework for - the user, these legacy variables are converted to the - appropriate options setting automatically. A warning is - issued to prompt the user to update <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/etc/mk.conf</code> for each option. To + ease transition to the options framework for the user, + these legacy variables are converted to the appropriate + options setting automatically. A warning is issued to + prompt the user to update <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> to use the options framework directly. Support for these legacy variables will be removed eventually.</p> @@ -3326,15 +3672,17 @@ CFLAGS= -xtarget=ultra -xarch=v9 already done), and then build a binary package from what was installed. You can then use the <span><strong class= "command">pkg_*</strong></span> tools to manipulate it. - Binary packages are created by default in <code class= + Binary packages are created by default in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgsrc/packages</code>, in the form of a gzipped tar file. See <a href="#logs.package" title= - "B.2. Packaging figlet">Section B.2, + "2.2. Packaging figlet">Section 2.2, “Packaging figlet”</a> for a continuation of the above <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/misc/figlet/README.html" - class="pkgname">misc/figlet</a> example.</p> + target="_top"><code xmlns="" class= + "filename">misc/figlet</code></a> example.</p> <p>See <a href="#submit" title= "Chapter 17. Submitting and Committing">Chapter @@ -3405,8 +3753,10 @@ CFLAGS= -xtarget=ultra -xarch=v9 </div> </div> - <p>You may want to set variables in <code class= - "filename">/etc/mk.conf</code>. Look at <code class= + <p>You may want to set variables in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/mk.conf</code>. Look at <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/mk/defaults/mk.conf</code> for details of the default settings. You will want to ensure that <code class= @@ -3431,20 +3781,25 @@ _ACCEPTABLE= yes <div> <div> <h4 class="title"><a name="build.conf" id= - "build.conf"></a>6.3.1.2. <code class= - "filename">build.conf</code></h4> + "build.conf"></a>6.3.1.2. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" + class="filename">build.conf</code></h4> </div> </div> </div> - <p>In <code class="filename">pkgsrc/mk/bulk</code>, - copy <code class="filename">build.conf-example</code> - to <code class="filename">build.conf</code> and edit - it, following the comments in that file. This is the - config file that determines where log files are - generated after the build, where to mail the build - report to, where your pkgsrc tree is located and the - user to which user to <a href= + <p>In <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">pkgsrc/mk/bulk</code>, copy <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">build.conf-example</code> to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">build.conf</code> and edit it, following + the comments in that file. This is the config file + that determines where log files are generated after + the build, where to mail the build report to, where + your pkgsrc tree is located and the user to which + user to <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?su+8+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">su</span>(8)</span></a> to do a @@ -3457,24 +3812,29 @@ _ACCEPTABLE= yes <div> <div> <h4 class="title"><a name="pre-build.local" id= - "pre-build.local"></a>6.3.1.3. <code class="filename"> - pre-build.local</code></h4> + "pre-build.local"></a>6.3.1.3. <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">pre-build.local</code></h4> </div> </div> </div> <p>It is possible to configure the bulk build to perform certain site specific tasks at the end of the - pre-build stage. If the file <code class= + pre-build stage. If the file <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pre-build.local</code> exists in - <code class="filename">/usr/pkgsrc/mk/bulk</code>, it - will be executed (as a <a href= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/pkgsrc/mk/bulk</code>, it will be + executed (as a <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?sh+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">sh</span>(1)</span></a> script) at the end of the usual pre-build stage. An example use - of <code class="filename">pre-build.local</code> is - to have the line:</p> + of <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">pre-build.local</code> is to have the + line:</p> <pre class="screen"> <code class="prompt">#</code> <strong class= "userinput"><code>echo "I do not have enough disk space to build this pig." \ @@ -3499,24 +3859,28 @@ _ACCEPTABLE= yes </div> </div> - <p>As <code class="filename">/usr/pkg</code> will be - completely deleted at the start of bulk builds, make - sure your login shell is placed somewhere else. Either - drop it into <code class= - "filename">/usr/local/bin</code> (and adjust your login - shell in the passwd file), or (re-)install it via + <p>As <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/pkg</code> will be completely deleted + at the start of bulk builds, make sure your login shell + is placed somewhere else. Either drop it into + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/usr/local/bin</code> (and adjust your + login shell in the passwd file), or (re-)install it via <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">pkg_add</span>(1)</span></a> from - <code class="filename">/etc/rc.local</code>, so you can - login after a reboot (remember that your current - process won't die if the package is removed, you just - can't start any new instances of the shell any more). - Also, if you use NetBSD earlier than 1.5, or you still - want to use the pkgsrc version of ssh for some reason, - be sure to install ssh before starting it from - <code class="filename">rc.local</code>:</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/etc/rc.local</code>, so you can login + after a reboot (remember that your current process + won't die if the package is removed, you just can't + start any new instances of the shell any more). Also, + if you use NetBSD earlier than 1.5, or you still want + to use the pkgsrc version of ssh for some reason, be + sure to install ssh before starting it from + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">rc.local</code>:</p> <pre class="programlisting"> ( cd /usr/pkgsrc/security/ssh ; make bulk-install ) if [ -f /usr/pkg/etc/rc.d/sshd ]; then @@ -3554,8 +3918,9 @@ fi <p>Be sure to remove all other things that might interfere with builds, like some libs installed in - <code class="filename">/usr/local</code>, etc. then - become root and type:</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/usr/local</code>, etc. then become + root and type:</p> <pre class="screen"> <code class="prompt">#</code> <strong class= "userinput"><code>cd /usr/pkgsrc</code></strong> @@ -3574,7 +3939,8 @@ fi <p>At the end of the bulk build, you will get a summary via mail, and find build logs in the directory specified by <code class="varname">FTP</code> in the - <code class="filename">build.conf</code> file.</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">build.conf</code> file.</p> </div> <div class="sect2" lang="en" xml:lang="en"> @@ -3615,18 +3981,23 @@ fi <dd> <p>Generates a report that's placed in the - directory specified in the <code class= + directory specified in the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">build.conf</code> file named - <code class="filename">broken.html</code>, a - short version of that report will also be mailed - to the build's admin.</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">broken.html</code>, a short version of + that report will also be mailed to the build's + admin.</p> </dd> </dl> </div> <p>During the build, a list of broken packages will be - compiled in <code class= - "filename">/usr/pkgsrc/.broken</code> (or <code class= + compiled in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/pkgsrc/.broken</code> (or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.../.broken.${MACHINE}</code> if <code class="varname">OBJMACHINE</code> is set), individual build logs of broken builds can be found in @@ -3697,13 +4068,16 @@ fi package bulk build inside a chroot environment.</p> <p>The first step is to set up a chroot sandbox, e.g. - <code class="filename">/usr/sandbox</code>. This can be - done by using null mounts, or manually.</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/usr/sandbox</code>. This can be done + by using null mounts, or manually.</p> - <p>There is a shell script called <code class= + <p>There is a shell script called <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/mk/bulk/mksandbox</code> which will set up the sandbox environment using null mounts. It - will also create a script called <code class= + will also create a script called <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">sandbox</code> in the root of the sandbox environment, which will allow the null mounts to be activated using the <span><strong class= @@ -3714,7 +4088,8 @@ fi <p>To set up a sandbox environment by hand, after extracting all the sets from a NetBSD installation or doing a <span><strong class="command">make distribution - DESTDIR=/usr/sandbox</strong></span> in <code class= + DESTDIR=/usr/sandbox</strong></span> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/src/etc</code>, be sure the following items are present and properly configured:</p> @@ -3729,7 +4104,9 @@ fi </li> <li> - <p><code class="filename">/dev/*</code></p> + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/dev/*</code></p> <pre class="screen"> <code class="prompt">#</code> <strong class= "userinput"><code>cd /usr/sandbox/dev ; sh MAKEDEV all</code></strong> @@ -3737,11 +4114,14 @@ fi </li> <li> - <p><code class="filename">/etc/resolv.conf</code> - (for <a xmlns= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/resolv.conf</code> (for <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/smtpd/README.html" - class="pkgname">security/smtpd</a> and mail):</p> + target="_top"><code xmlns="" class= + "filename">security/smtpd</code></a> and + mail):</p> <pre class="screen"> <code class="prompt">#</code> <strong class= "userinput"><code>cp /etc/resolv.conf /usr/sandbox/etc</code></strong> @@ -3758,11 +4138,13 @@ fi </li> <li> - <p><code class="filename">/etc/localtime</code> - (for <a xmlns= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/localtime</code> (for <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/smtpd/README.html" - class="pkgname">security/smtpd</a>):</p> + target="_top"><code xmlns="" class= + "filename">security/smtpd</code></a>):</p> <pre class="screen"> <code class="prompt">#</code> <strong class= "userinput"><code>ln -sf /usr/share/zoneinfo/UTC /usr/sandbox/etc/localtime</code></strong> @@ -3770,14 +4152,19 @@ fi </li> <li> - <p><code class="filename">/usr/src</code> (system - sources, for <a xmlns= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/src</code> (system sources, for + <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/sysutils/aperture/README.html" - class="pkgname">sysutils/aperture</a>, <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= + target="_top"><code xmlns="" class= + "filename">sysutils/aperture</code></a>, + <a xmlns="http://www.w3.org/TR/xhtml1/transitional" + href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/net/ppp-mppe/README.html" - class="pkgname">net/ppp-mppe</a>):</p> + target="_top"><code xmlns="" class= + "filename">net/ppp-mppe</code></a>):</p> <pre class="screen"> <code class="prompt">#</code> <strong class= "userinput"><code>ln -s ../disk1/cvs .</code></strong> @@ -3787,7 +4174,8 @@ fi </li> <li> - <p>Create <code class= + <p>Create <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/var/db/pkg</code> (not part of default install):</p> <pre class="screen"> @@ -3797,8 +4185,10 @@ fi </li> <li> - <p>Create <code class="filename">/usr/pkg</code> - (not part of default install):</p> + <p>Create <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/pkg</code> (not part of default + install):</p> <pre class="screen"> <code class="prompt">#</code> <strong class= "userinput"><code>mkdir /usr/sandbox/usr/pkg</code></strong> @@ -3806,7 +4196,8 @@ fi </li> <li> - <p>Checkout pkgsrc via cvs into <code class= + <p>Checkout pkgsrc via cvs into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/sandbox/usr/pkgsrc</code>:</p> <pre class="screen"> <code class="prompt">#</code> <strong class= @@ -3821,15 +4212,19 @@ fi </li> <li> - <p>Make <code class= + <p>Make <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/sandbox/usr/pkgsrc/packages</code> - and <code class="filename">.../distfiles</code> - point somewhere appropriate. NFS- and/or - nullfs-mounts may come in handy!</p> + and <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.../distfiles</code> point somewhere + appropriate. NFS- and/or nullfs-mounts may come + in handy!</p> </li> <li> - <p>Edit <code class= + <p>Edit <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code>, see <a href= "#binary.mk.conf" title= "6.3.1.1. /etc/mk.conf">Section 6.3.1.1, @@ -3837,14 +4232,16 @@ fi </li> <li> - <p>Adjust <code class= + <p>Adjust <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">mk/bulk/build.conf</code> to suit your needs.</p> </li> <li> <p>If you have set <code class= - "varname">CVS_USER</code> in <code class= + "varname">CVS_USER</code> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">build.conf</code>, make sure that account exists and can do a <span><strong class= "command">cvs ${CVS_FLAGS} update</strong></span> @@ -3865,7 +4262,8 @@ fi <p>This will just jump inside the sandbox and start building. At the end of the build, mail will be sent with the results of the build. Created binary pkgs will - be in <code class= + be in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/sandbox/usr/pkgsrc/packages</code> (wherever that points/mounts to/from).</p> </div> @@ -3883,11 +4281,13 @@ fi </div> <p>In addition to building a complete set of all - packages in pkgsrc, the <code class= + packages in pkgsrc, the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/mk/bulk/build</code> script may be used to build a subset of the packages contained in pkgsrc. By setting defining <code class= - "varname">SPECIFIC_PKGS</code> in <code class= + "varname">SPECIFIC_PKGS</code> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code>, the variables</p> <div class="itemizedlist"> @@ -3941,21 +4341,23 @@ fi <p>If you would like to automatically create checksum files for the binary packages you intend to upload, remember to set <code class="varname">MKSUMS=yes</code> - in your <code class= + in your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">mk/bulk/build.conf</code>.</p> <p>If you would like to PGP sign the checksum files (highly recommended!), remember to set <code class= "varname">SIGN_AS=username@NetBSD.org</code> in your - <code class="filename">mk/bulk/build.conf</code>. This - will prompt you for your GPG password to sign the files + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">mk/bulk/build.conf</code>. This will + prompt you for your GPG password to sign the files before uploading everything.</p> <p>Then, make sure that you have <code class= "varname">RSYNC_DST</code> set properly in your - <code class="filename">mk/bulk/build.conf</code> file, - i.e. adjust it to something like one of the - following:</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">mk/bulk/build.conf</code> file, i.e. + adjust it to something like one of the following:</p> <pre class="screen"> RSYNC_DST=$CVS_USER@ftp.NetBSD.org:/pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload </pre> @@ -3970,20 +4372,23 @@ RSYNC_DST=$CVS_USER@ftp.NetBSD.org:/pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b RSYNC_DST=hubertf@ftp.NetBSD.org:/pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload </pre> - <p>A separate <code class="filename">upload</code> - directory is used here to allow "closing" the directory - during upload. To do so, run the following command on - ftp.NetBSD.org next:</p> + <p>A separate <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">upload</code> directory is used here to + allow "closing" the directory during upload. To do so, + run the following command on ftp.NetBSD.org next:</p> <pre class="screen"> nbftp% <strong class= "userinput"><code>mkdir -p -m 750 /pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch/upload</code></strong> </pre> - <p>Please note that <code class= + <p>Please note that <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/pub/NetBSD/packages</code> is only appropriate for packages for the NetBSD operating system. Binary packages for other operating systems - should go into <code class= + should go into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/pub/pkgsrc</code>.</p> <p>Before uploading the binary pkgs, ssh authentication @@ -4002,11 +4407,13 @@ chroot-<code class="prompt">#</code> <strong class= "userinput"><code>cat $HOME/.ssh/id-dsa.pub</code></strong> </pre> - <p>Now take the output of <code class= + <p>Now take the output of <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">id-dsa.pub</code> and append it to your - <code class="filename">~/.ssh/authorized_keys</code> - file on ftp.NetBSD.org. You can remove the key after - the upload is done!</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">~/.ssh/authorized_keys</code> file on + ftp.NetBSD.org. You can remove the key after the upload + is done!</p> <p>Next, test if your ssh connection really works:</p> <pre class="screen"> @@ -4038,8 +4445,8 @@ chroot-<code class="prompt">#</code> <strong class= server to monitor progress of the upload. The upload script will take care of not uploading restricted packages and putting vulnerable packages into the - <code class="filename">vulnerable</code> - subdirectory.</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">vulnerable</code> subdirectory.</p> <p>After the upload has ended, first thing is to revoke ssh access:</p> @@ -4051,8 +4458,10 @@ Gdd:x! <p>Use whatever is needed to remove the key you've entered before! Last, move the uploaded packages out of - the <code class="filename">upload</code> directory to - have them accessible to everyone:</p> + the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">upload</code> directory to have them + accessible to everyone:</p> <pre class="screen"> nbftp% <strong class= "userinput"><code>cd /pub/NetBSD/packages/pkgsrc-200xQy/NetBSD-a.b.c/arch</code></strong> @@ -4082,7 +4491,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> machines. The <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/cdpack/README.html" - class="pkgname">pkgtools/cdpack</a> package provides a + target="_top"><code xmlns="" class= + "filename">pkgtools/cdpack</code></a> package provides a simple tool for creating the ISO 9660 images. <span><strong class="command">cdpack</strong></span> arranges the packages on the CD-ROMs in a way that keeps @@ -4102,9 +4512,11 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p>Complete documentation for cdpack is found in the cdpack(1) manpage. The following short example assumes - that the binary packages are left in <code class= + that the binary packages are left in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgsrc/packages/All</code> and that - sufficient disk space exists in <code class= + sufficient disk space exists in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/u2</code> to hold the ISO 9660 images.</p> <pre class="screen"> <code class="prompt">#</code> <strong class= @@ -4116,7 +4528,9 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> </pre> <p>If you wish to include a common set of files - (<code class="filename">COPYRIGHT</code>, <code class= + (<code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">COPYRIGHT</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">README</code>, etc.) on each CD in the collection, then you need to create a directory which contains these files. e.g.</p> @@ -4143,9 +4557,12 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> "userinput"><code>cdpack -x /tmp/common /usr/pkgsrc/packages/All /u2/images</code></strong> </pre> - <p>Each image will contain <code class= - "filename">README</code>, <code class= - "filename">COPYING</code>, and <code class= + <p>Each image will contain <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">README</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">COPYING</code>, and <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bin/myscript</code> in their root directories.</p> </div> @@ -4308,7 +4725,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> </div> <p>Pkgviews is tightly integrated with buildlink. You can - find a pkgviews User's guide in <code class= + find a pkgviews User's guide in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/mk/buildlink3/PKGVIEWS_UG</code>.</p> </div> @@ -4324,12 +4742,14 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> </div> </div> - <p>The <code class="filename">pkgsrc/pkgtools</code> - directory pkgtools contains a number of useful utilities - for both users and developers of pkgsrc. This section - attempts only to make the reader aware of the utilities - and when they might be useful, and not to duplicate the - documentation that comes with each package.</p> + <p>The <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">pkgsrc/pkgtools</code> directory pkgtools + contains a number of useful utilities for both users and + developers of pkgsrc. This section attempts only to make + the reader aware of the utilities and when they might be + useful, and not to duplicate the documentation that comes + with each package.</p> <p>Utilities used by pkgsrc (automatically installed when needed):</p> @@ -4340,7 +4760,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/x11-links/README.html" - class="pkgname">pkgtools/x11-links</a>: Symlinks + target="_top"><code xmlns="" class= + "filename">pkgtools/x11-links</code></a>: Symlinks for use by buildlink.</p> </li> </ul> @@ -4355,7 +4776,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/digest/README.html" - class="pkgname">pkgtools/digest</a>: Calculates + target="_top"><code xmlns="" class= + "filename">pkgtools/digest</code></a>: Calculates various kinds of checksums (including SHA1).</p> </li> @@ -4363,7 +4785,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/libnbcompat/README.html" - class="pkgname">pkgtools/libnbcompat</a>: + target="_top"><code xmlns="" class= + "filename">pkgtools/libnbcompat</code></a>: Compatibility library for pkgsrc tools.</p> </li> @@ -4371,7 +4794,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/mtree/README.html" - class="pkgname">pkgtools/mtree</a>: Installed on + target="_top"><code xmlns="" class= + "filename">pkgtools/mtree</code></a>: Installed on non-BSD systems due to lack of native mtree.</p> </li> @@ -4379,8 +4803,10 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_install/README.html" - class="pkgname">pkgtools/pkg_install</a>: - Up-to-date replacement for <code class= + target="_top"><code xmlns="" class= + "filename">pkgtools/pkg_install</code></a>: + Up-to-date replacement for <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/sbin/pkg_install</code>, or for use on operating systems where pkg_install is not present.</p> @@ -4397,7 +4823,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_tarup/README.html" - class="pkgname">pkgtools/pkg_tarup</a>: Create a + target="_top"><code xmlns="" class= + "filename">pkgtools/pkg_tarup</code></a>: Create a binary package from an already-installed package. Used by <span><strong class="command">make replace</strong></span> to save the old @@ -4408,7 +4835,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/dfdisk/README.html" - class="pkgname">pkgtools/dfdisk</a>: Adds extra + target="_top"><code xmlns="" class= + "filename">pkgtools/dfdisk</code></a>: Adds extra functionality to pkgsrc, allowing it to fetch distfiles from multiple locations. It currently supports the following methods: multiple CD-ROMs @@ -4419,7 +4847,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/xpkgwedge/README.html" - class="pkgname">pkgtools/xpkgwedge</a>: Put X11 + target="_top"><code xmlns="" class= + "filename">pkgtools/xpkgwedge</code></a>: Put X11 packages someplace else (enabled by default).</p> </li> @@ -4427,7 +4856,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/cpuflags/README.html" - class="pkgname">devel/cpuflags</a>: Determine the + target="_top"><code xmlns="" class= + "filename">devel/cpuflags</code></a>: Determine the best compiler flags to optimise code for your current CPU and compiler.</p> </li> @@ -4443,7 +4873,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_chk/README.html" - class="pkgname">pkgtools/pkg_chk</a>: Reports on + target="_top"><code xmlns="" class= + "filename">pkgtools/pkg_chk</code></a>: Reports on packages whose installed versions do not match the latest pkgsrc entries.</p> </li> @@ -4452,7 +4883,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdep/README.html" - class="pkgname">pkgtools/pkgdep</a>: Makes + target="_top"><code xmlns="" class= + "filename">pkgtools/pkgdep</code></a>: Makes dependency graphs of packages, to aid in choosing a strategy for updating.</p> </li> @@ -4461,11 +4893,13 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdepgraph/README.html" - class="pkgname">pkgtools/pkgdepgraph</a>: Makes + target="_top"><code xmlns="" class= + "filename">pkgtools/pkgdepgraph</code></a>: Makes graphs from the output of <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdep/README.html" - class="pkgname">pkgtools/pkgdep</a> (uses + target="_top"><code xmlns="" class= + "filename">pkgtools/pkgdep</code></a> (uses graphviz).</p> </li> @@ -4473,7 +4907,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkglint/README.html" - class="pkgname">pkgtools/pkglint</a>: The + target="_top"><code xmlns="" class= + "filename">pkgtools/pkglint</code></a>: The pkglint(1) program checks a pkgsrc entry for errors, lintpkgsrc(1) does various checks on the complete pkgsrc system.</p> @@ -4483,8 +4918,9 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgsurvey/README.html" - class="pkgname">pkgtools/pkgsurvey</a>: Report what - packages you have installed.</p> + target="_top"><code xmlns="" class= + "filename">pkgtools/pkgsurvey</code></a>: Report + what packages you have installed.</p> </li> </ul> </div> @@ -4498,7 +4934,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdiff/README.html" - class="pkgname">pkgtools/pkgdiff</a>: Automate + target="_top"><code xmlns="" class= + "filename">pkgtools/pkgdiff</code></a>: Automate making and maintaining patches for a package (includes pkgdiff, pkgvi, mkpatches, etc.).</p> </li> @@ -4507,10 +4944,12 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/rpm2pkg/README.html" - class="pkgname">pkgtools/rpm2pkg</a>, <a xmlns= + target="_top"><code xmlns="" class= + "filename">pkgtools/rpm2pkg</code></a>, <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/url2pkg/README.html" - class="pkgname">pkgtools/url2pkg</a>: Aids in + target="_top"><code xmlns="" class= + "filename">pkgtools/url2pkg</code></a>: Aids in converting to pkgsrc.</p> </li> @@ -4518,7 +4957,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/gensolpkg/README.html" - class="pkgname">pkgtools/gensolpkg</a>: Convert + target="_top"><code xmlns="" class= + "filename">pkgtools/gensolpkg</code></a>: Convert pkgsrc to a Solaris package.</p> </li> </ul> @@ -4533,7 +4973,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgconflict/README.html" - class="pkgname">pkgtools/pkgconflict</a>: Find + target="_top"><code xmlns="" class= + "filename">pkgtools/pkgconflict</code></a>: Find packages that conflict but aren't marked as such.</p> </li> @@ -4542,7 +4983,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_comp/README.html" - class="pkgname">pkgtools/pkg_comp</a>: Build + target="_top"><code xmlns="" class= + "filename">pkgtools/pkg_comp</code></a>: Build packages in a chrooted area.</p> </li> @@ -4550,8 +4992,9 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p><a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/libkver/README.html" - class="pkgname">pkgtools/libkver</a>: Spoof kernel - version for chrooted cross builds.</p> + target="_top"><code xmlns="" class= + "filename">pkgtools/libkver</code></a>: Spoof + kernel version for chrooted cross builds.</p> </li> </ul> </div> @@ -4592,7 +5035,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> “<span class= "quote">--ignore-user-check</span>” flag, as it will choose and use multiple default directories under - <code class="filename">~/pkg</code> as the installation + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">~/pkg</code> as the installation targets. These directories can be overriden by the “<span class="quote">--prefix</span>” flag provided by the script, as well as some others that allow @@ -4614,9 +5058,11 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <p>By default resuming transfers in pkgsrc is disabled, but you can enable this feature by adding the option <code class="varname">PKG_RESUME_TRANSFERS=YES</code> - into <code class="filename">/etc/mk.conf</code>. If, - during a fetch step, an incomplete distfile is found, - pkgsrc will try to resume it.</p> + into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/mk.conf</code>. If, during a fetch step, + an incomplete distfile is found, pkgsrc will try to + resume it.</p> <p>You can also use a different program than the default <a href= @@ -4629,7 +5075,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> "varname">FETCH_OUTPUT_ARGS</code> if you are not using default values.</p> - <p>For example, if you want to use <code class= + <p>For example, if you want to use <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">wget</code> to resume downloads, you'll have to use something like:</p> <pre class="programlisting"> @@ -4653,10 +5100,13 @@ FETCH_OUTPUT_ARGS=-O </div> <p>If you want to use XFree86 from pkgsrc instead of your - system's own X11 (<code class= - "filename">/usr/X11R6</code>, <code class= + system's own X11 (<code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/X11R6</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/openwin</code>, ...), you will have to - add the following line into <code class= + add the following line into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code>:</p> <pre class="programlisting"> X11_TYPE=XFree86 @@ -4676,10 +5126,13 @@ X11_TYPE=XFree86 </div> <p>If you want to use X.org from pkgsrc instead of your - system's own X11 (<code class= - "filename">/usr/X11R6</code>, <code class= + system's own X11 (<code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/X11R6</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/openwin</code>, ...) you will have to add - the following line into <code class= + the following line into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code>:</p> <pre class="programlisting"> X11_TYPE=xorg @@ -4725,32 +5178,40 @@ http_proxy=http://orpheus.amdahl.com:80/ </div> <p>This depends on which utility is used to retrieve - distfiles. From <code class="filename">bsd.pkg.mk</code>, - <code class="varname">FETCH_CMD</code> is assigned the - first available command from the following list:</p> + distfiles. From <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">bsd.pkg.mk</code>, <code class= + "varname">FETCH_CMD</code> is assigned the first + available command from the following list:</p> <div class="itemizedlist"> <ul type="disc"> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${LOCALBASE}/bin/ftp</code></p> </li> <li> - <p><code class="filename">/usr/bin/ftp</code></p> + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/bin/ftp</code></p> </li> </ul> </div> <p>On a default NetBSD installation, this will be - <code class="filename">/usr/bin/ftp</code>, which - automatically tries passive connections first, and falls - back to active connections if the server refuses to do - passive. For the other tools, add the following to your - <code class="filename">/etc/mk.conf</code> file: - <code class="varname">PASSIVE_FETCH=1</code>.</p> - - <p>Having that option present will prevent <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/usr/bin/ftp</code>, which automatically + tries passive connections first, and falls back to active + connections if the server refuses to do passive. For the + other tools, add the following to your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/mk.conf</code> file: <code class= + "varname">PASSIVE_FETCH=1</code>.</p> + + <p>Having that option present will prevent <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/bin/ftp</code> from falling back to active transfers.</p> </div> @@ -4777,7 +5238,8 @@ http_proxy=http://orpheus.amdahl.com:80/ entire directory may not be appropriate.</p> <p>The answer here is to do a <span><strong class= - "command">make fetch-list</strong></span> in <code class= + "command">make fetch-list</strong></span> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgsrc</code> or one of it's subdirectories, carry the resulting list to your machine at work/school and use it there. If you don't have a @@ -4805,7 +5267,8 @@ http_proxy=http://orpheus.amdahl.com:80/ "userinput"><code>sh /tmp/fetch.sh</code></strong> </pre> - <p>then tar up <code class= + <p>then tar up <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/tmp/distfiles</code> and take it home.</p> <p>If you have a machine running NetBSD, and you want to @@ -4845,10 +5308,12 @@ http_proxy=http://orpheus.amdahl.com:80/ <p>When compiling the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_install/README.html" - class="pkgname">pkgtools/pkg_install</a> package, you get - the error from make that it doesn't know how to make - <code class="filename">/usr/share/tmac/tmac.andoc</code>? - This indicates that you don't have installed the + target="_top"><code xmlns="" class= + "filename">pkgtools/pkg_install</code></a> package, you + get the error from make that it doesn't know how to make + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/usr/share/tmac/tmac.andoc</code>? This + indicates that you don't have installed the “<span class="quote">text</span>” set (nroff, ...) from the NetBSD base distribution on your machine. It is recommended to do that to format manpages.</p> @@ -4856,10 +5321,12 @@ http_proxy=http://orpheus.amdahl.com:80/ <p>In the case of the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkg_install/README.html" - class="pkgname">pkgtools/pkg_install</a> package, you can - get away with setting <code class= + target="_top"><code xmlns="" class= + "filename">pkgtools/pkg_install</code></a> package, you + can get away with setting <code class= "varname">NOMAN=YES</code> either in the environment or - in <code class="filename">/etc/mk.conf</code>.</p> + in <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/etc/mk.conf</code>.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -4875,10 +5342,13 @@ http_proxy=http://orpheus.amdahl.com:80/ </div> </div> - <p>You didn't install the compiler set, <code class= + <p>You didn't install the compiler set, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">comp.tgz</code>, when you installed your NetBSD machine. Please get it and install it, by - extracting it in <code class="filename">/</code>:</p> + extracting it in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/</code>:</p> <pre class="screen"> <code class="prompt">#</code> <strong class= "userinput"><code>cd /</code></strong> @@ -4886,10 +5356,11 @@ http_proxy=http://orpheus.amdahl.com:80/ "userinput"><code>tar --unlink -zxvpf .../comp.tgz</code></strong> </pre> - <p><code class="filename">comp.tgz</code> is part of - every NetBSD release. Get the one that corresponds to - your release (determine via <span><strong class= - "command">uname -r</strong></span>).</p> + <p><code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">comp.tgz</code> is part of every NetBSD + release. Get the one that corresponds to your release + (determine via <span><strong class="command">uname + -r</strong></span>).</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -4916,8 +5387,10 @@ http_proxy=http://orpheus.amdahl.com:80/ (either as binary package or from <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/sudo/README.html" - class="pkgname">security/sudo</a>) and then put the - following into your <code class= + target="_top"><code xmlns="" class= + "filename">security/sudo</code></a>) and then put the + following into your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code>:</p> <pre class="programlisting"> .if exists(${LOCALBASE}/bin/sudo) @@ -4939,7 +5412,8 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c <p>As the system administrator, you can choose where configuration files are installed. The default settings - make all these files go into <code class= + make all these files go into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}/etc</code> or some of its subdirectories; this may be suboptimal depending on your expectations (e.g., a read-only, NFS-exported @@ -4948,10 +5422,14 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c <p>In order to change the defaults, you can modify the <code class="varname">PKG_SYSCONFBASE</code> variable (in - <code class="filename">/etc/mk.conf</code>) to point to - your preferred configuration directory; some common - examples include <code class="filename">/etc</code> or - <code class="filename">/etc/pkg</code>.</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/etc/mk.conf</code>) to point to your + preferred configuration directory; some common examples + include <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc</code> or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/pkg</code>.</p> <p>Furthermore, you can change this value on a per-package basis by setting the <code class= @@ -4988,7 +5466,8 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c this, install the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/audit-packages/README.html" - class="pkgname">security/audit-packages</a> package. It + target="_top"><code xmlns="" class= + "filename">security/audit-packages</code></a> package. It has two components:</p> <div class="orderedlist"> @@ -5024,7 +5503,8 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c <p>Use of the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/security/audit-packages/README.html" - class="pkgname">security/audit-packages</a> package is + target="_top"><code xmlns="" class= + "filename">security/audit-packages</code></a> package is strongly recommended! After “<span class= "quote">audit-packages</span>” is installed, please read the package's message, which you can get by running @@ -5039,8 +5519,8 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c <div> <div> <h1 class="title"><a name="developers-guide" id= - "developers-guide"></a>The pkgsrc developer's - guide</h1> + "developers-guide"></a>Part 2. The pkgsrc + developer's guide</h1> </div> </div> </div> @@ -5056,11 +5536,13 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c <dd> <dl> <dt><span class="sect1"><a href= - "#components.Makefile">8.1. <code class= + "#components.Makefile">8.1. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code></a></span></dt> <dt><span class="sect1"><a href= - "#components.distinfo">8.2. <code class= + "#components.distinfo">8.2. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">distinfo</code></a></span></dt> <dt><span class="sect1"><a href= @@ -5075,21 +5557,27 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c files</a></span></dt> <dt><span class="sect1"><a href="#work-dir">8.6. - <code class="filename">work*</code></a></span></dt> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">work*</code></a></span></dt> <dt><span class="sect1"><a href="#files-dir">8.7. - <code class="filename">files/*</code></a></span></dt> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">files/*</code></a></span></dt> </dl> </dd> <dt><span class="chapter"><a href="#makefile">9. - Programming in <code class= + Programming in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>s</a></span></dt> <dd> <dl> <dt><span class="sect1"><a href= - "#makefile.variables">9.1. <code class= + "#makefile.variables">9.1. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code> variables</a></span></dt> <dd> @@ -5140,8 +5628,9 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c <dt><span class="sect1"><a href= "#automatic-plist-generation">10.2. Semi-automatic - <code class="filename">PLIST</code> - generation</a></span></dt> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code> generation</a></span></dt> <dt><span class="sect1"><a href="#print-PLIST">10.3. Tweaking output of <span><strong class="command">make @@ -5179,7 +5668,8 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c to use buildlink3</a></span></dt> <dt><span class="sect1"><a href= - "#creating-buildlink3.mk">11.2. Writing <code class= + "#creating-buildlink3.mk">11.2. Writing <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> files</a></span></dt> <dd> @@ -5192,22 +5682,25 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c "#updating-buildlink-depends">11.2.2. Updating <code class= "varname">BUILDLINK_DEPENDS.<em class="replaceable"> - <code>pkg</code></em></code> in <code class= + <code>pkg</code></em></code> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> files</a></span></dt> </dl> </dd> <dt><span class="sect1"><a href= - "#writing-builtin.mk">11.3. Writing <code class= + "#writing-builtin.mk">11.3. Writing <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">builtin.mk</code> files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= "#anatomy-of-builtin.mk">11.3.1. Anatomy of a - <code class="filename">builtin.mk</code> - file</a></span></dt> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">builtin.mk</code> file</a></span></dt> <dt><span class="sect2"><a href= "#native-or-pkgsrc-preference">11.3.2. Global @@ -5304,7 +5797,8 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c <dt><span class="sect1"><a href= "#converting-to-options">13.2. Converting packages to - use <code class= + use <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.options.mk</code></a></span></dt> </dl> </dd> @@ -5562,11 +6056,13 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c <dl> <dt><span class="sect1"><a href= - "#components.Makefile">8.1. <code class= + "#components.Makefile">8.1. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code></a></span></dt> <dt><span class="sect1"><a href= - "#components.distinfo">8.2. <code class= + "#components.distinfo">8.2. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">distinfo</code></a></span></dt> <dt><span class="sect1"><a href= @@ -5581,10 +6077,12 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c files</a></span></dt> <dt><span class="sect1"><a href="#work-dir">8.6. - <code class="filename">work*</code></a></span></dt> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">work*</code></a></span></dt> <dt><span class="sect1"><a href="#files-dir">8.7. - <code class="filename">files/*</code></a></span></dt> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">files/*</code></a></span></dt> </dl> </div> @@ -5598,21 +6096,26 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c <div> <h2 class="title" style="clear: both"><a name= "components.Makefile" id= - "components.Makefile"></a>8.1. <code class= + "components.Makefile"></a>8.1. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code></h2> </div> </div> </div> <p>Building, installation and creation of a binary - package are all controlled by the package's <code class= - "filename">Makefile</code>. The <code class= + package are all controlled by the package's <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code>. The <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code> describes various things about a package, for example from where to get it, how to configure, build, and install it.</p> - <p>A package <code class="filename">Makefile</code> - contains several sections that describe the package.</p> + <p>A package <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code> contains several sections that + describe the package.</p> <p>In the first section there are the following variables, which should appear exactly in the order given @@ -5644,26 +6147,159 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c list of categories which the package fits in. You can choose any of the top-level directories of pkgsrc for it.</p> + + <p>Currently the following values are available for + <code class="varname">CATEGORIES</code>. If more + than one is used, they need to be separated by + spaces:</p> + <pre class="programlisting"> +archivers cross geography meta-pkgs security +audio databases graphics misc shells +benchmarks devel ham multimedia sysutils +biology editors inputmethod net textproc +cad emulators lang news time +chat finance mail parallel wm +comms fonts math pkgtools www +converters games mbone print x11 +</pre> </li> <li> <p><code class="varname">MASTER_SITES</code> is a list of URLs where the distribution files can be downloaded. Each URL must end with a slash.</p> + + <p>The <code class="varname">MASTER_SITES</code> + may make use of the following predefined sites:</p> + <pre class="programlisting"> + ${MASTER_SITE_APACHE} + ${MASTER_SITE_BACKUP} + ${MASTER_SITE_CYGWIN} + ${MASTER_SITE_DEBIAN} + ${MASTER_SITE_FREEBSD} + ${MASTER_SITE_FREEBSD_LOCAL} + ${MASTER_SITE_GNOME} + ${MASTER_SITE_GNU} + ${MASTER_SITE_GNUSTEP} + ${MASTER_SITE_IFARCHIVE} + ${MASTER_SITE_MOZILLA} + ${MASTER_SITE_OPENOFFICE} + ${MASTER_SITE_PERL_CPAN} + ${MASTER_SITE_R_CRAN} + ${MASTER_SITE_SOURCEFORGE} + ${MASTER_SITE_SUNSITE} + ${MASTER_SITE_SUSE} + ${MASTER_SITE_TEX_CTAN} + ${MASTER_SITE_XCONTRIB} + ${MASTER_SITE_XEMACS} + +</pre> + + <p>If one of these predefined sites is chosen, you + may want to specify a subdirectory of that site. + Since these macros may expand to more than one + actual site, you <span class= + "emphasis"><em>must</em></span> use the following + construct to specify a subdirectory:</p> + <pre class="programlisting"> + ${MASTER_SITE_GNU:=subdirectory/name/} + ${MASTER_SITE_SOURCEFORGE:=project_name/} +</pre> + + <p>Note the trailing slash after the subdirectory + name.</p> + + <p>If the package has multiple <code class= + "varname">DISTFILES</code> or multiple <code class= + "varname">PATCHFILES</code> from different sites, + set <code class="varname">SITES_foo</code> to a + list of URI's where file “<span class= + "quote">foo</span>” may be found. + “<span class="quote">foo</span>” + includes the suffix, e.g.</p> + <pre class="programlisting"> +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} +DISTFILES+= foo-file.tar.gz +SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ + http://www.somewhereelse.com/mirror/somehow/ +</pre> + </li> + + <li> + <p><code class="varname">DISTFILES</code>: Name(s) + of archive file(s) containing distribution. The + default is <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${DISTNAME}${EXTRACT_SUFX}</code>. + Should only be set if you have more than one + distfile.</p> + + <p>Note that the normal default setting of + <code class="varname">DISTFILES</code> must be made + explicit if you want to add to it (rather than + replace it), as you usually would.</p> + </li> + + <li> + <p><code class="varname">EXTRACT_SUFX</code>: + Suffix of the distribution file, will be appended + to <code class="varname">DISTNAME</code>. Defaults + to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.tar.gz</code>.</p> + </li> + </ul> + </div> + + <p>The second section contains information about + separately downloaded patches, if any.</p> + + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p><code class="varname">PATCHFILES</code> Name(s) + of additional files that contain distribution + patches. There is no default. pkgsrc will look for + them at <code class="varname">PATCH_SITES</code>. + They will automatically be uncompressed before + patching if the names end with <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.gz</code> or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.Z</code>.</p> + </li> + + <li> + <p><code class="varname">PATCH_SITES</code>: + Primary location(s) for distribution patch files + (see <code class="varname">PATCHFILES</code> below) + if not found locally.</p> </li> </ul> </div> - <p>The second section contains the following + <p>The third section contains the following variables.</p> <div class="itemizedlist"> <ul type="disc"> <li> <p><code class="varname">MAINTAINER</code> is the - mail address of the package's maintainer, which is - the person you can contact when the package does - not work.</p> + email address of the contact person for this + package. The person who feels responsible for this + package, and who is most likely to look at problems + or questions regarding this package which have been + reported with <a href= + "http://netbsd.gw.com/cgi-bin/man-cgi?send-pr+1+NetBSD-current"> + <span class="citerefentry"><span class= + "refentrytitle">send-pr</span>(1)</span></a>. The + right person to contact before making major changes + to the package. When packaging a new program, set + <code class="varname">MAINTAINER</code> to + yourself. If you really can't maintain the package + for future updates, set it to <code class= + "email"><<a href= + "mailto:tech-pkg@NetBSD.org">tech-pkg@NetBSD.org</a>></code>.</p> </li> <li> @@ -5674,94 +6310,33 @@ SU_CMD=${LOCALBASE}/bin/sudo /bin/sh -c <li> <p><code class="varname">COMMENT</code> is a - one-line comment about the purpose of the - package.</p> + one-line description of the package (should not + include the package name).</p> </li> </ul> </div> - <p>The <code class="varname">MASTER_SITES</code> may be - set to one of the predefined sites:</p> - <pre class="programlisting"> - ${MASTER_SITE_APACHE} - ${MASTER_SITE_BACKUP} - ${MASTER_SITE_CYGWIN} - ${MASTER_SITE_DEBIAN} - ${MASTER_SITE_FREEBSD} - ${MASTER_SITE_FREEBSD_LOCAL} - ${MASTER_SITE_GNOME} - ${MASTER_SITE_GNU} - ${MASTER_SITE_GNUSTEP} - ${MASTER_SITE_IFARCHIVE} - ${MASTER_SITE_MOZILLA} - ${MASTER_SITE_OPENOFFICE} - ${MASTER_SITE_PERL_CPAN} - ${MASTER_SITE_R_CRAN} - ${MASTER_SITE_SOURCEFORGE} - ${MASTER_SITE_SUNSITE} - ${MASTER_SITE_SUSE} - ${MASTER_SITE_TEX_CTAN} - ${MASTER_SITE_XCONTRIB} - ${MASTER_SITE_XEMACS} - -</pre> + <p>Other variables that affect the build:</p> - <p>If one of these predefined sites is chosen, you may - require the ability to specify a subdirectory of that - site. Since these macros may expand to more than one - actual site, you <span class= - "emphasis"><em>must</em></span> use the following - construct to specify a subdirectory:</p> - <pre class="programlisting"> - ${MASTER_SITE_GNU:=subdirectory/name/} - ${MASTER_SITE_SOURCEFORGE:=project_name/} -</pre> - - <p>Note the trailing slash after the subdirectory - name.</p> - - <div class="note" style= - "margin-left: 0.5in; margin-right: 0.5in;"> - <h3 class="title">Note</h3> - - <p><code class="varname">MASTER_SITE_SUBDIR</code> has - been deprecated and <span class="emphasis"><em>should - no longer be used</em></span>.</p> + <div class="itemizedlist"> + <ul type="disc"> + <li> + <p><code class="varname">WRKSRC</code>: The + subdirectory of <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${WRKDIR}</code> to which the + distribution actually unpacks. The default is + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${WRKDIR}/${DISTNAME}</code>. The value + of <code class="varname">WRKSRC</code> should be + set explicitly if the package does not follow + standard conventions and include the package's name + as a subdirectory.</p> + </li> + </ul> </div> - <p>If the package has multiple <code class= - "varname">DISTFILES</code> or multiple <code class= - "varname">PATCHFILES</code> from different sites, set - <code class="varname">SITES_foo</code> to a list of URI's - where file “<span class="quote">foo</span>” - may be found. “<span class= - "quote">foo</span>” includes the suffix, e.g.</p> - <pre class="programlisting"> -DISTFILES= ${DISTNAME}${EXTRACT_SUFX} -DISTFILES+= foo-file.tar.gz -SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ - http://www.somewhereelse.com/mirror/somehow/ -</pre> - - <p>Note that the normal default setting of <code class= - "varname">DISTFILES</code> must be made explicit if you - want to add to it (rather than replace it), as you - usually would.</p> - - <p>Currently the following values are available for - <code class="varname">CATEGORIES</code>. If more than one - is used, they need to be separated by spaces:</p> - <pre class="programlisting"> -archivers cross geography meta-pkgs security -audio databases graphics misc shells -benchmarks devel ham multimedia sysutils -biology editors inputmethod net textproc -cad emulators lang news time -chat finance mail parallel wm -comms fonts math pkgtools www -converters games mbone print x11 -</pre> - <p>Please pay attention to the following gotchas:</p> <div class="itemizedlist"> @@ -5769,47 +6344,26 @@ converters games mbone print x11 <li> <p>Add <code class="varname">MANCOMPRESSED</code> if manpages are installed in compressed form by the - package; see comment in <code class= + package; see comment in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.pkg.mk</code>.</p> </li> <li> - <p>Replace <code class="filename">/usr/local</code> - with “<span class= - "quote">${PREFIX}</span>” in all files (see - patches, below).</p> + <p>Replace <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/local</code> with + “<span class="quote">${PREFIX}</span>” + in all files (see patches, below).</p> </li> <li> <p>If the package installs any info files, see <a href="#faq.info-files" title= - "15.5.7. Packages installing info files">Section - 15.5.7, “Packages installing info + "15.5.7. Packages installing info files">Section 15.5.7, + “Packages installing info files”</a>.</p> </li> - - <li> - <p>Set <code class="varname">MAINTAINER</code> to - be yourself. If you really can't maintain the - package for future updates, set it to <code class= - "email"><<a href= - "mailto:tech-pkg@NetBSD.org">tech-pkg@NetBSD.org</a>></code>.</p> - </li> - - <li> - <p>If a home page for the software in question - exists, add the variable <code class= - "varname">HOMEPAGE</code> right after <code class= - "varname">MAINTAINER</code>. The value of this - variable should be the URL for the home page.</p> - </li> - - <li> - <p>Be sure to set the <code class= - "varname">COMMENT</code> variable to a short - description of the package, not containing the - pkg's name.</p> - </li> </ul> </div> </div> @@ -5820,7 +6374,8 @@ converters games mbone print x11 <div> <h2 class="title" style="clear: both"><a name= "components.distinfo" id= - "components.distinfo"></a>8.2. <code class= + "components.distinfo"></a>8.2. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">distinfo</code></h2> </div> </div> @@ -5841,7 +6396,8 @@ converters games mbone print x11 in new distinfo files. The <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/digest/README.html" - class="pkgname">pkgtools/digest</a> utility calculates + target="_top"><code xmlns="" class= + "filename">pkgtools/digest</code></a> utility calculates all of the digests in the distinfo file, and it provides various different algorithms. At the current time, the algorithms provided are: <span class= @@ -5856,21 +6412,25 @@ converters games mbone print x11 per architecture basis, for example <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/navigator/README.html" - class="pkgname">www/navigator</a>). These are kept in the - same distinfo file and care should be taken when + target="_top"><code xmlns="" class= + "filename">www/navigator</code></a>). These are kept in + the same distinfo file and care should be taken when upgrading such a package to ensure distfile information is not lost.</p> <p>The message digest/checksum for all the official - patches found in the <code class= + patches found in the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">patches/</code> directory (see <a href= "#components.patches" title= "8.3. patches/*">Section 8.3, “patches/*”</a>) for the package is also - stored in the <code class="filename">distinfo</code> - file. This is a message digest/checksum of all lines in - the patch file except the NetBSD RCS Id. This file is - generated by invoking <span><strong class="command">make + stored in the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">distinfo</code> file. This is a message + digest/checksum of all lines in the patch file except the + NetBSD RCS Id. This file is generated by invoking + <span><strong class="command">make makepatchsum</strong></span> (or <span><strong class= "command">make mps</strong></span> if you're in a hurry).</p> @@ -5897,14 +6457,17 @@ converters games mbone print x11 NetBSD. The files are applied successively in alphabetic order (as returned by a shell “<span class= "quote">patches/patch-*</span>” glob expansion), so - <code class="filename">patch-aa</code> is applied before - <code class="filename">patch-ab</code>, etc.</p> - - <p>The <code class="filename">patch-*</code> files should - be in <span><strong class="command">diff - -bu</strong></span> format, and apply without a fuzz to - avoid problems. (To force patches to apply with fuzz you - can set <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">patch-aa</code> is applied before + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">patch-ab</code>, etc.</p> + + <p>The <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">patch-*</code> files should be in + <span><strong class="command">diff -bu</strong></span> + format, and apply without a fuzz to avoid problems. (To + force patches to apply with fuzz you can set <code class= "varname">PATCH_FUZZ_FACTOR=-F2</code>). Furthermore, do not put changes for more than one file into a single patch-file, as this will make future modifications more @@ -5922,14 +6485,16 @@ converters games mbone print x11 "command">pkgdiff</strong></span> from the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdiff/README.html" - class="pkgname">pkgtools/pkgdiff</a> package to avoid + target="_top"><code xmlns="" class= + "filename">pkgtools/pkgdiff</code></a> package to avoid these problems.</p> <p>For even more automation, we recommend using <span><strong class="command">mkpatches</strong></span> from the same package to make a whole set of patches. You just have to backup files before you edit them to - <code class="filename">filename.orig</code>, e.g. with + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">filename.orig</code>, e.g. with <span><strong class="command">cp -p filename filename.orig</strong></span> or, easier, by using <span><strong class="command">pkgvi</strong></span> again @@ -5944,7 +6509,8 @@ converters games mbone print x11 makepatchsum</strong></span> command, see <a href= "#components.distinfo" title= "8.2. distinfo">Section 8.2, - “<code class="filename">distinfo</code>”</a>.</p> + “<code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">distinfo</code>”</a>.</p> <p>Patch files that are distributed by the author or other maintainers can be listed in <code class= @@ -5952,16 +6518,20 @@ converters games mbone print x11 <p>If it is desired to store any patches that should not be committed into pkgsrc, they can be kept outside the - pkgsrc tree in the <code class= + pkgsrc tree in the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">$LOCALPATCHES</code> directory. The directory tree there is expected to have the same “<span class="quote">category/package</span>” structure as pkgsrc, and patches are expected to be - stored inside these dirs (also known as <code class= + stored inside these dirs (also known as <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">$LOCALPATCHES/$PKGPATH</code>). For example if - you want to keep a private patch for <code class= + you want to keep a private patch for <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/graphics/png</code>, keep it in - <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class= "filename">$LOCALPATCHES/graphics/png/mypatch</code>. All files in the named directory are expected to be patch files, and <span class="emphasis"><em>they are applied @@ -5982,7 +6552,8 @@ converters games mbone print x11 <div class="variablelist"> <dl> - <dt><span class="term"><code class= + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">DESCR</code></span></dt> <dd> @@ -5994,7 +6565,8 @@ converters games mbone print x11 everything that you write here.</p> </dd> - <dt><span class="term"><code class= + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code></span></dt> <dd> @@ -6025,7 +6597,8 @@ converters games mbone print x11 <div class="variablelist"> <dl> - <dt><span class="term"><code class= + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">INSTALL</code></span></dt> <dd> @@ -6037,8 +6610,9 @@ converters games mbone print x11 moved in place, the second time after the files to install are moved in place. This can be used to do any custom procedures not possible with @exec - commands in <code class="filename">PLIST</code>. - See <a href= + commands in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code>. See <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">pkg_add</span>(1)</span></a> and @@ -6049,7 +6623,8 @@ converters games mbone print x11 more information.</p> </dd> - <dt><span class="term"><code class= + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">DEINSTALL</code></span></dt> <dd> @@ -6069,7 +6644,8 @@ converters games mbone print x11 more information.</p> </dd> - <dt><span class="term"><code class= + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">MESSAGE</code></span></dt> <dd> @@ -6080,13 +6656,16 @@ converters games mbone print x11 Please note that you can modify variables in it easily by using <code class= "varname">MESSAGE_SUBST</code> in the package's - <code class="filename">Makefile</code>:</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code>:</p> <pre class="programlisting"> MESSAGE_SUBST+= SOMEVAR="somevalue" </pre> <p>replaces "${SOMEVAR}" with “<span class= - "quote">somevalue</span>” in <code class= + "quote">somevalue</span>” in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">MESSAGE</code>.</p> </dd> </dl> @@ -6098,7 +6677,8 @@ MESSAGE_SUBST+= SOMEVAR="somevalue" <div> <div> <h2 class="title" style="clear: both"><a name= - "work-dir" id="work-dir"></a>8.6. <code class= + "work-dir" id="work-dir"></a>8.6. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">work*</code></h2> </div> </div> @@ -6106,11 +6686,18 @@ MESSAGE_SUBST+= SOMEVAR="somevalue" <p>When you type <span><strong class= "command">make</strong></span> the distribution files are - unpacked into this directory. It can be removed by - running <span><strong class="command">make - clean</strong></span>. Besides the sources, this - directory is also used to keep various timestamp - files.</p> + unpacked into the directory denoted by <code class= + "varname">WRKDIR</code>. It can be removed by running + <span><strong class="command">make clean</strong></span>. + Besides the sources, this directory is also used to keep + various timestamp files. The directory gets <span class= + "emphasis"><em>removed completely</em></span> on clean. + The default is <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${.CURDIR}/work</code> or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${.CURDIR}/work.${MACHINE_ARCH}</code> if + <code class="varname">OBJMACHINE</code> is set.</p> <p>If a package doesn't create a subdirectory for itself (like GNU software does, for instance), but extracts @@ -6118,38 +6705,42 @@ MESSAGE_SUBST+= SOMEVAR="somevalue" <code class="varname">WRKSRC</code> accordingly, e.g. <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/editors/sam/README.html" - class="pkgname">editors/sam</a> again, but the quick + target="_top"><code xmlns="" class= + "filename">editors/sam</code></a> again, but the quick answer is:</p> <pre class="programlisting"> WRKSRC= ${WRKDIR} </pre> - <p>Please note that the old <code class= - "varname">NO_WRKSUBDIR</code> has been deprecated and - should not be used. Also, if your package doesn't create - a subdir with the name of <code class= - "varname">DISTNAME</code> but some different name, set - <code class="varname">WRKSRC</code> to point to the - proper name in <code class="filename">${WRKDIR}</code>. - See <a xmlns="http://www.w3.org/TR/xhtml1/transitional" - href= + <p>If a package doesn't create a subdir with the name of + <code class="varname">DISTNAME</code> but some different + name, set <code class="varname">WRKSRC</code> to point to + the proper name in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${WRKDIR}</code>. See <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/lang/tcl/README.html" - class="pkgname">lang/tcl</a> and <a xmlns= + target="_top"><code xmlns="" class= + "filename">lang/tcl</code></a> and <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/tk/README.html" - class="pkgname">x11/tk</a> for examples, and here is + target="_top"><code xmlns="" class= + "filename">x11/tk</code></a> for examples, and here is another one:</p> <pre class="programlisting"> WRKSRC= ${WRKDIR}/${DISTNAME}/unix </pre> <p>The name of the working directory created by pkgsrc is - <code class="filename">work</code> by default. If the - same pkgsrc tree should be used on several different + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">work</code> by default. If the same + pkgsrc tree should be used on several different platforms, the variable <code class= "varname">OBJMACHINE</code> can be set in /etc/mk.conf to attach the platform to the directory name, e.g. - <code class="filename">work.i386</code> or <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">work.i386</code> or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">work.sparc</code>.</p> </div> @@ -6159,7 +6750,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <div> <h2 class="title" style="clear: both"><a name= "files-dir" id= - "files-dir"></a>8.7. <code class= + "files-dir"></a>8.7. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">files/*</code></h2> </div> </div> @@ -6171,7 +6763,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix "quote">${CP}</span>” command in the “<span class="quote">pre-configure</span>” target to achieve this. Alternatively, you could simply - diff the file against <code class= + diff the file against <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/dev/null</code> and use the patch mechanism to manage the creation of this file.</p> </div> @@ -6183,7 +6776,9 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <div> <h2 class="title"><a name="makefile" id= "makefile"></a>Chapter 9. Programming in - <code class="filename">Makefile</code>s</h2> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code>s</h2> </div> </div> </div> @@ -6193,7 +6788,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <dl> <dt><span class="sect1"><a href= - "#makefile.variables">9.1. <code class= + "#makefile.variables">9.1. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code> variables</a></span></dt> <dd> @@ -6234,7 +6830,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix </dl> </div> - <p>Pkgsrc consists of many <code class= + <p>Pkgsrc consists of many <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code> fragments, each of which forms a well-defined part of the pkgsrc system. Using the <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"> @@ -6244,7 +6841,8 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix some discipline to keep the code correct and understandable.</p> - <p>The basic ingredients for <code class= + <p>The basic ingredients for <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code> programming are variables (which are actually macros) and shell commands. Among these shell commands may even be more complex ones like <a href= @@ -6256,8 +6854,10 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix used.</p> <p>This chapter describes some patterns, that appear quite - often in <code class="filename">Makefile</code>s, including - the pitfalls that come along with them.</p> + often in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code>s, including the pitfalls that + come along with them.</p> <div class="sect1" lang="en" xml:lang="en"> <div class="titlepage"> @@ -6265,21 +6865,24 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <div> <h2 class="title" style="clear: both"><a name= "makefile.variables" id= - "makefile.variables"></a>9.1. <code class= + "makefile.variables"></a>9.1. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code> variables</h2> </div> </div> </div> - <p><code class="filename">Makefile</code> variables - contain strings that can be processed using the five - operators ``='', ``+='', ``?='', ``:='', and ``!='', - which are described in the <a href= + <p><code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">Makefile</code> variables contain + strings that can be processed using the five operators + ``='', ``+='', ``?='', ``:='', and ``!='', which are + described in the <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">make</span>(1)</span></a> man page.</p> - <p>When a variable's value is parsed from a <code class= + <p>When a variable's value is parsed from a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>, the hash character ``#'' and the backslash character ``\'' are handled specially. If a backslash is followed by a newline, any whitespace @@ -6383,7 +6986,9 @@ WRKSRC= ${WRKDIR}/${DISTNAME}/unix <p>All variable names starting with an underscore are reserved for use by the pkgsrc infrastructure. They shall not be used by package - <code class="filename">Makefile</code>s.</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code>s.</p> </li> <li> @@ -6695,7 +7300,8 @@ for_test: see the package <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/regress/make-quoting/README.html" - class="pkgname">regress/make-quoting</a>, testcase + target="_top"><code xmlns="" class= + "filename">regress/make-quoting</code></a>, testcase <code class="varname">bug1</code>.</p> </div> </div> @@ -6720,7 +7326,8 @@ for_test: <dt><span class="sect1"><a href= "#automatic-plist-generation">10.2. Semi-automatic - <code class="filename">PLIST</code> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">PLIST</code> generation</a></span></dt> <dt><span class="sect1"><a href="#print-PLIST">10.3. @@ -6748,17 +7355,21 @@ for_test: </dl> </div> - <p>The <code class="filename">PLIST</code> file contains a - package's “<span class="quote">packing - list</span>”, i.e. a list of files that belong to the - package (relative to the <code class= - "filename">${PREFIX}</code> directory it's been installed - in) plus some additional statements - see the <a href= + <p>The <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code> file contains a package's + “<span class="quote">packing list</span>”, i.e. + a list of files that belong to the package (relative to the + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">${PREFIX}</code> directory it's been + installed in) plus some additional statements - see the + <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_create+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">pkg_create</span>(1)</span></a> manpage for a full list. This chapter addresses some issues that need - attention when dealing with the <code class= + attention when dealing with the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code> file (or files, see below!).</p> <div class="sect1" lang="en" xml:lang="en"> @@ -6772,7 +7383,8 @@ for_test: </div> <p>Be sure to add a RCS ID line as the first thing in any - <code class="filename">PLIST</code> file you write:</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">PLIST</code> file you write:</p> <pre class="programlisting"> @comment $NetBSD$ </pre> @@ -6785,7 +7397,9 @@ for_test: <h2 class="title" style="clear: both"><a name= "automatic-plist-generation" id= "automatic-plist-generation"></a>10.2. Semi-automatic - <code class="filename">PLIST</code> generation</h2> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code> generation</h2> </div> </div> </div> @@ -6832,7 +7446,8 @@ for_test: of AWK scripting you like to it, but be careful with quoting.</p> - <p>For example, to get all files inside the <code class= + <p>For example, to get all files inside the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">libdata/foo</code> directory removed from the resulting PLIST:</p> <pre class="programlisting"> @@ -6907,7 +7522,8 @@ for_test: <dd> <p>Some packages want to embed the OS name and version into some paths. To do this, use these - variables in the <code class= + variables in the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code>:</p> <div class="itemizedlist"> @@ -6947,14 +7563,18 @@ for_test: "quote">share/locale/de/LC_MESSAGES/...</span>”. This properly handles the fact that different operating systems expect locale files to be either - in <code class="filename">share</code> or - <code class="filename">lib</code> by default.</p> + in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">share</code> or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">lib</code> by default.</p> </dd> </dl> </div> <p>For a complete list of values which are replaced by - default, please look in <code class= + default, please look in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.pkg.mk</code> (and search for <span class= "emphasis"><em>PLIST_SUBST</em></span>).</p> @@ -6986,17 +7606,21 @@ PLIST_SUBST+= SOMEVAR="somevalue" </div> <p>Manpages should be installed in compressed form if - <code class="varname">MANZ</code> is set (in <code class= + <code class="varname">MANZ</code> is set (in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.own.mk</code>), and uncompressed - otherwise. To handle this in the <code class= + otherwise. To handle this in the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code> file, the suffix “<span class="quote">.gz</span>” is appended/removed automatically for manpages according to <code class="varname">MANZ</code> and <code class= "varname">MANCOMPRESSED</code> being set or not, see - above for details. This modification of the <code class= + above for details. This modification of the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code> file is done on a copy of it, not - <code class="filename">PLIST</code> itself.</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">PLIST</code> itself.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -7013,8 +7637,9 @@ PLIST_SUBST+= SOMEVAR="somevalue" </div> <p>To use one or more files as source for the - <code class="filename">PLIST</code> used in generating - the binary package, set the variable <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">PLIST</code> used in generating the + binary package, set the variable <code class= "varname">PLIST_SRC</code> to the names of that file(s). The files are later concatenated using <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?cat+1+NetBSD-current"> @@ -7043,25 +7668,32 @@ PLIST_SUBST+= SOMEVAR="somevalue" <div class="itemizedlist"> <ul type="disc"> <li> - <p><code class="filename">PLIST.common</code></p> + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST.common</code></p> </li> <li> - <p><code class="filename">PLIST.${OPSYS}</code></p> + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST.${OPSYS}</code></p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST.${MACHINE_ARCH}</code></p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST.${OPSYS}-${MACHINE_ARCH}</code></p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST.common_end</code></p> </li> </ul> @@ -7110,8 +7742,10 @@ PLIST_SUBST+= SOMEVAR="somevalue" <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/textproc/scrollkeeper/README.html" - class="pkgname">textproc/scrollkeeper</a>, which - removes the shared directory <code class= + target="_top"><code xmlns="" class= + "filename">textproc/scrollkeeper</code></a>, which + removes the shared directory <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">share/omf</code>.</p> </li> @@ -7139,8 +7773,9 @@ PLIST_SUBST+= SOMEVAR="somevalue" writing new packages).</p> <p>For example, if a package installs files under - <code class="filename">share/applications</code>, it - should have the following line in it:</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">share/applications</code>, it should + have the following line in it:</p> <pre class="programlisting"> USE_DIRS+= xdg-1.1 @@ -7151,10 +7786,12 @@ PLIST_SUBST+= SOMEVAR="somevalue" print-PLIST</strong></span>, you should get the right (commented out) lines.</p> - <p>Note that, even if your package is using <code class= + <p>Note that, even if your package is using <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">$X11BASE</code>, it must not depend on the *-x11-dirs packages. Just specify the name without that - part and pkgsrc (in particular, <code class= + part and pkgsrc (in particular, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">mk/dirs.mk</code>) will take care of it.</p> </div> </div> @@ -7179,7 +7816,8 @@ PLIST_SUBST+= SOMEVAR="somevalue" to use buildlink3</a></span></dt> <dt><span class="sect1"><a href= - "#creating-buildlink3.mk">11.2. Writing <code class= + "#creating-buildlink3.mk">11.2. Writing <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> files</a></span></dt> <dd> @@ -7192,21 +7830,25 @@ PLIST_SUBST+= SOMEVAR="somevalue" "#updating-buildlink-depends">11.2.2. Updating <code class="varname">BUILDLINK_DEPENDS.<em class= "replaceable"><code>pkg</code></em></code> in - <code class="filename">buildlink3.mk</code> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">buildlink3.mk</code> files</a></span></dt> </dl> </dd> <dt><span class="sect1"><a href= - "#writing-builtin.mk">11.3. Writing <code class= + "#writing-builtin.mk">11.3. Writing <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">builtin.mk</code> files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= "#anatomy-of-builtin.mk">11.3.1. Anatomy of a - <code class="filename">builtin.mk</code> - file</a></span></dt> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">builtin.mk</code> file</a></span></dt> <dt><span class="sect2"><a href= "#native-or-pkgsrc-preference">11.3.2. Global @@ -7249,8 +7891,10 @@ PLIST_SUBST+= SOMEVAR="somevalue" <p>This normalizes the environment in which a package is built so that the package may be built consistently despite what other software may be installed. Please note that the - normal system header and library paths, e.g. <code class= - "filename">/usr/include</code>, <code class= + normal system header and library paths, e.g. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/usr/include</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/lib</code>, etc., are always searched -- buildlink3 is designed to insulate the package build from non-system-supplied software.</p> @@ -7278,7 +7922,8 @@ PLIST_SUBST+= SOMEVAR="somevalue" <p>Ensure that the build always calls the wrapper scripts instead of the actual toolchain. Some packages are tricky, and the only way to know for - sure is the check <code class= + sure is the check <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${WRKDIR}/.work.log</code> to see if the wrappers are being invoked.</p> </li> @@ -7287,7 +7932,8 @@ PLIST_SUBST+= SOMEVAR="somevalue" <p>Don't override <code class= "varname">PREFIX</code> from within the package Makefile, e.g. Java VMs, standalone shells, etc., - because the code to symlink files into <code class= + because the code to symlink files into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${BUILDLINK_DIR}</code> looks for files relative to “<span class="quote">pkg_info -qp <em class= @@ -7296,7 +7942,8 @@ PLIST_SUBST+= SOMEVAR="somevalue" <li> <p>Remember that <span class= - "emphasis"><em>only</em></span> the <code class= + "emphasis"><em>only</em></span> the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> files that you list in a package's Makefile are added as dependencies for that package.</p> @@ -7315,88 +7962,104 @@ DEPENDS+= foo>=1.1.0:../../category/foo .include "../../category/foo/buildlink3.mk" </pre> - <p>There are several <code class= - "filename">buildlink3.mk</code> files in <code class= + <p>There are several <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">buildlink3.mk</code> files in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/mk</code> that handle special package issues:</p> <div class="itemizedlist"> <ul type="disc"> <li> - <p><code class="filename">bdb.buildlink3.mk</code> - chooses either the native or a pkgsrc Berkeley DB - implementation based on the values of <code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">bdb.buildlink3.mk</code> chooses either + the native or a pkgsrc Berkeley DB implementation + based on the values of <code class= "varname">BDB_ACCEPTED</code> and <code class= "varname">BDB_DEFAULT</code>.</p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">curses.buildlink3.mk</code> If the system comes with neither Curses nor NCurses, this will take care to install the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/ncurses/README.html" - class="pkgname">devel/ncurses</a> package.</p> + target="_top"><code xmlns="" class= + "filename">devel/ncurses</code></a> package.</p> </li> <li> - <p><code class="filename">krb5.buildlink3.mk</code> - uses the value of <code class= - "varname">KRB5_ACCEPTED</code> to choose between - adding a dependency on Heimdal or MIT-krb5 for - packages that require a Kerberos 5 + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">krb5.buildlink3.mk</code> uses the value + of <code class="varname">KRB5_ACCEPTED</code> to + choose between adding a dependency on Heimdal or + MIT-krb5 for packages that require a Kerberos 5 implementation.</p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">motif.buildlink3.mk</code> checks for a system-provided Motif installation or adds a dependency on <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/lesstif/README.html" - class="pkgname">x11/lesstif</a> or <a xmlns= + target="_top"><code xmlns="" class= + "filename">x11/lesstif</code></a> or <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/openmotif/README.html" - class="pkgname">x11/openmotif</a>;</p> + target="_top"><code xmlns="" class= + "filename">x11/openmotif</code></a>;</p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">ossaudio.buildlink3.mk</code> defines several variables that may be used by packages that use the Open Sound System (OSS) API;</p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pgsql.buildlink3.mk</code> will accept either Postgres 7.3 or 7.4, whichever is found installed. See the file for more information.</p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pthread.buildlink3.mk</code> uses the value of <code class="varname">PTHREAD_OPTS</code> and checks for native pthreads or adds a dependency on <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/pth/README.html" - class="pkgname">devel/pth</a> as needed;</p> + target="_top"><code xmlns="" class= + "filename">devel/pth</code></a> as needed;</p> </li> <li> - <p><code class="filename">xaw.buildlink3.mk</code> - uses the value of <code class= - "varname">XAW_TYPE</code> to choose a particular - Athena widgets library.</p> + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">xaw.buildlink3.mk</code> uses the value + of <code class="varname">XAW_TYPE</code> to choose + a particular Athena widgets library.</p> </li> </ul> </div> - <p>The comments in those <code class= + <p>The comments in those <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> files provide a more complete description of how to use them properly.</p> </div> @@ -7408,32 +8071,39 @@ DEPENDS+= foo>=1.1.0:../../category/foo <h2 class="title" style="clear: both"><a name= "creating-buildlink3.mk" id= "creating-buildlink3.mk"></a>11.2. Writing - <code class="filename">buildlink3.mk</code> - files</h2> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">buildlink3.mk</code> files</h2> </div> </div> </div> - <p>A package's <code class= + <p>A package's <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file is included by Makefiles to indicate the need to compile and link against header files and libraries provided by the - package. A <code class="filename">buildlink3.mk</code> - file should always provide enough information to add the - correct type of dependency relationship and include any - other <code class="filename">buildlink3.mk</code> files - that it needs to find headers and libraries that it needs - in turn.</p> - - <p>To generate an initial <code class= + package. A <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">buildlink3.mk</code> file should always + provide enough information to add the correct type of + dependency relationship and include any other + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">buildlink3.mk</code> files that it needs + to find headers and libraries that it needs in turn.</p> + + <p>To generate an initial <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file for further editing, Rene Hexel's <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/createbuildlink/README.html" - class="pkgname">pkgtools/createbuildlink</a> package is + target="_top"><code xmlns="" class= + "filename">pkgtools/createbuildlink</code></a> package is highly recommended. For most packages, the following command will generate a good starting point for - <code class="filename">buildlink3.mk</code> files:</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">buildlink3.mk</code> files:</p> <pre class="screen"> <code class="prompt">%</code> <strong class= "userinput"><code>cd pkgsrc/<em class= @@ -7454,9 +8124,11 @@ DEPENDS+= foo>=1.1.0:../../category/foo </div> </div> - <p>The following real-life example <code class= + <p>The following real-life example <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> is taken from - <code class="filename">pkgsrc/graphics/tiff</code>:</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">pkgsrc/graphics/tiff</code>:</p> <pre class="programlisting"> # $NetBSD: buildlink3.mk,v 1.7 2004/03/18 09:12:12 jlam Exp $ @@ -7483,10 +8155,12 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <p>The header and footer manipulate <code class= "varname">BUILDLINK_DEPTH</code>, which is common - across all <code class="filename">buildlink3.mk</code> - files and is used to track at what depth we are - including <code class="filename">buildlink3.mk</code> - files.</p> + across all <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">buildlink3.mk</code> files and is used to + track at what depth we are including <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">buildlink3.mk</code> files.</p> <p>The first section controls if the dependency on <em class="replaceable"><code>pkg</code></em> is added. @@ -7495,15 +8169,19 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} added by buildlink3.</p> <p>The second section advises pkgsrc that the - <code class="filename">buildlink3.mk</code> file for + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">buildlink3.mk</code> file for <em class="replaceable"><code>pkg</code></em> has been included at some point. <code class= "varname">BUILDLINK_PACKAGES</code> is the global list - of packages for which <code class= + of packages for which <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> files have been included. It must <span class= "emphasis"><em>always</em></span> be appended to within - a <code class="filename">buildlink3.mk</code> file.</p> + a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">buildlink3.mk</code> file.</p> <p>The third section is protected from multiple inclusion and controls how the dependency on <em class= @@ -7559,7 +8237,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <code class= "varname">BUILDLINK_LIBDIRS.<em class="replaceable"> <code>pkg</code></em></code> (not shown above) - are lists of subdirectories of <code class= + are lists of subdirectories of <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${BUILDLINK_PREFIX.<em class= "replaceable"><code>pkg</code></em>}</code> to add to the header and library search paths. These @@ -7589,7 +8268,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <p>The following variables are all optionally defined within this second section (protected against multiple inclusion) and control which package files are - symlinked into <code class= + symlinked into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${BUILDLINK_DIR}</code> and how their names are transformed during the symlinking:</p> @@ -7600,12 +8280,16 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} "varname">BUILDLINK_FILES.<em class= "replaceable"><code>pkg</code></em></code> (not shown above) is a shell glob pattern relative to - <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${BUILDLINK_PREFIX.<em class= "replaceable"><code>pkg</code></em>}</code> to be - symlinked into <code class= + symlinked into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${BUILDLINK_DIR}</code>, e.g. - <code class="filename">include/*.h</code>.</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">include/*.h</code>.</p> </li> <li> @@ -7613,12 +8297,16 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} "varname">BUILDLINK_FILES_CMD.<em class= "replaceable"><code>pkg</code></em></code> (not shown above) is a shell pipeline that outputs to - stdout a list of files relative to <code class= + stdout a list of files relative to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${BUILDLINK_PREFIX.<em class= "replaceable"><code>pkg</code></em>}</code>. The resulting files are to be symlinked into - <code class="filename">${BUILDLINK_DIR}</code>. - By default, this takes the <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${BUILDLINK_DIR}</code>. By default, + this takes the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">+CONTENTS</code> of a <em class= "replaceable"><code>pkg</code></em> and filters it through <code class= @@ -7631,21 +8319,29 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} "varname">BUILDLINK_CONTENTS_FILTER.<em class= "replaceable"><code>pkg</code></em></code> (not shown above) is a filter command that filters - <code class="filename">+CONTENTS</code> input - into a list of files relative to <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">+CONTENTS</code> input into a list of + files relative to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${BUILDLINK_PREFIX.<em class= "replaceable"><code>pkg</code></em>}</code> on stdout. By default for overwrite packages, <code class= "varname">BUILDLINK_CONTENTS_FILTER.<em class= "replaceable"><code>pkg</code></em></code> - outputs the contents of the <code class= - "filename">include</code> and <code class= + outputs the contents of the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">include</code> and <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">lib</code> directories in the package - <code class="filename">+CONTENTS</code>, and for - pkgviews packages, it outputs any libtool - archives in <code class="filename">lib</code> - directories.</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">+CONTENTS</code>, and for pkgviews + packages, it outputs any libtool archives in + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">lib</code> directories.</p> </li> <li> @@ -7661,16 +8357,20 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} </ul> </div> - <p>The last section includes any <code class= + <p>The last section includes any <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> needed for <em class= "replaceable"><code>pkg</code></em>'s library - dependencies. Including these <code class= + dependencies. Including these <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> files means that the headers and libraries for these dependencies are also - symlinked into <code class= + symlinked into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${BUILDLINK_DIR}</code> whenever the <em class="replaceable"><code>pkg</code></em> - <code class="filename">buildlink3.mk</code> file is + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">buildlink3.mk</code> file is included.</p> </div> @@ -7683,7 +8383,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} "updating-buildlink-depends"></a>11.2.2. Updating <code class= "varname">BUILDLINK_DEPENDS.<em class="replaceable"> - <code>pkg</code></em></code> in <code class= + <code>pkg</code></em></code> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> files</h3> </div> </div> @@ -7717,14 +8418,15 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} In some cases, the packages that depend on this new version may need their <code class= "varname">PKGREVISION</code>s increased and, if they - have <code class="filename">buildlink3.mk</code> files, - their <code class= - "varname">BUILDLINK_DEPENDS.<em class="replaceable"><code> - pkg</code></em></code> adjusted, too. This is needed so - that binary packages made using it will require the - correct package dependency and not settle for an older - one which will not contain the necessary shared - libraries.</p> + have <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">buildlink3.mk</code> files, their + <code class="varname">BUILDLINK_DEPENDS.<em class= + "replaceable"><code>pkg</code></em></code> adjusted, + too. This is needed so that binary packages made using + it will require the correct package dependency and not + settle for an older one which will not contain the + necessary shared libraries.</p> <p>Please take careful consideration before adjusting <code class="varname">BUILDLINK_DEPENDS.<em class= @@ -7748,16 +8450,20 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <h2 class="title" style="clear: both"><a name= "writing-builtin.mk" id= "writing-builtin.mk"></a>11.3. Writing - <code class="filename">builtin.mk</code> files</h2> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">builtin.mk</code> files</h2> </div> </div> </div> <p>Some packages in pkgsrc install headers and libraries that coincide with headers and libraries present in the - base system. Aside from a <code class= + base system. Aside from a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file, these packages - should also include a <code class= + should also include a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">builtin.mk</code> file that includes the necessary checks to decide whether using the built-in software or the pkgsrc software is appropriate.</p> @@ -7781,7 +8487,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} "emphasis"><em>not</em></span> override any <code class="varname">USE_BUILTIN.<em class= "replaceable"><code>pkg</code></em></code> which is - already set before the <code class= + already set before the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">builtin.mk</code> file is included.</p> </li> @@ -7789,7 +8496,8 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <p>It should be written to allow multiple inclusion. This is <span class= "emphasis"><em>very</em></span> important and takes - careful attention to <code class= + careful attention to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code> coding.</p> </li> </ol> @@ -7802,8 +8510,9 @@ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} <h3 class="title"><a name="anatomy-of-builtin.mk" id= "anatomy-of-builtin.mk"></a>11.3.1. Anatomy - of a <code class="filename">builtin.mk</code> - file</h3> + of a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">builtin.mk</code> file</h3> </div> </div> </div> @@ -7862,7 +8571,8 @@ CHECK_BUILTIN.foo?= no should only be “<span class= "quote">yes</span>” if the actual package is included as part of the base system. This variable is - only used internally within the <code class= + only used internally within the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">builtin.mk</code> file.</p> <p>The second section sets <code class= @@ -7875,16 +8585,18 @@ CHECK_BUILTIN.foo?= no "replaceable"><code>pkg</code></em></code> is “<span class="quote">yes</span>”). This variable is only used internally within the - <code class="filename">builtin.mk</code> file.</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">builtin.mk</code> file.</p> <p>The third section sets <code class= "varname">USE_BUILTIN.<em class= "replaceable"><code>pkg</code></em></code> and is <span class="emphasis"><em>required</em></span> in all - <code class="filename">builtin.mk</code> files. The - code in this section must make the determination - whether the built-in software is adequate to satisfy - the dependencies listed in <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">builtin.mk</code> files. The code in + this section must make the determination whether the + built-in software is adequate to satisfy the + dependencies listed in <code class= "varname">BUILDLINK_DEPENDS.<em class= "replaceable"><code>pkg</code></em></code>. This is typically done by comparing <code class= @@ -7896,7 +8608,8 @@ CHECK_BUILTIN.foo?= no <code class="varname">USE_BUILTIN.<em class= "replaceable"><code>pkg</code></em></code> <span class= "emphasis"><em>must</em></span> be set to the correct - value by the end of the <code class= + value by the end of the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">builtin.mk</code> file. Note that <code class="varname">USE_BUILTIN.<em class= "replaceable"><code>pkg</code></em></code> may be @@ -7916,7 +8629,8 @@ CHECK_BUILTIN.foo?= no "replaceable"><code>pkg</code></em></code> set in the previous section. This typically includes, e.g., adding additional dependency restrictions and listing - additional files to symlink into <code class= + additional files to symlink into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${BUILDLINK_DIR}</code> (via <code class= "varname">BUILDLINK_FILES.<em class= "replaceable"><code>pkg</code></em></code>).</p> @@ -7963,7 +8677,8 @@ CHECK_BUILTIN.foo?= no </pre> <p>A package <span class= - "emphasis"><em>must</em></span> have a <code class= + "emphasis"><em>must</em></span> have a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">builtin.mk</code> file to be listed in <code class="varname">PREFER_NATIVE</code>, otherwise it is simply ignored in that list.</p> @@ -8092,7 +8807,9 @@ CHECK_BUILTIN.foo?= no <p>The following sections inspect each of the above points in detail. Note that, in order to use any of the described functionalities, you must add the following to your - package's <code class="filename">Makefile</code>:</p> + package's <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code>:</p> <pre class="programlisting"> USE_PKGINSTALL=YES </pre> @@ -8121,16 +8838,21 @@ USE_PKGINSTALL=YES </div> </div> - <p>As you already know, the <code class= + <p>As you already know, the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code> file holds a list of files and directories that belong to a package. The names used in - it are relative to the installation prefix (<code class= + it are relative to the installation prefix (<code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}</code>), which means that it cannot register files outside this directory (absolute path names are not allowed). Despite this restriction, some packages need to install files outside this location; - e.g., under <code class="filename">${VARBASE}</code> or - <code class="filename">${PKG_SYSCONFDIR}</code>.</p> + e.g., under <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${VARBASE}</code> or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${PKG_SYSCONFDIR}</code>.</p> <p>The only way to achieve this is to create such files during installation time by using the installation @@ -8139,7 +8861,8 @@ USE_PKGINSTALL=YES anywhere in the filesystem. Here is where pkginstall comes into play: it provides generic scripts to abstract the manipulation of such files and directories based on - variables set in the package's <code class= + variables set in the package's <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>. The rest of this section describes which these variables are.</p> @@ -8204,7 +8927,8 @@ MAKE_DIRS_PERMS+= ${VARBASE}/foo/private ${ROOT_USER} ${ROOT_GROUP} 0700 </div> <p>Creating non-empty files outside the installation - prefix is tricky because the <code class= + prefix is tricky because the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code> forces all files to be inside it. To overcome this problem, the only solution is to extract the file in the known place (i.e., inside the @@ -8306,10 +9030,14 @@ SUPPORT_FILES_PERMS+= ${PREFIX}/share/somefile ${VARBASE}/somefile ${ROOT_USER} <li> <p><code class="varname">PKG_SYSCONFBASE</code>: The configuration's root directory. Defaults to - <code class="filename">${PREFIX}/etc</code> - although it may be overridden by the user to - point to his preferred location (e.g., - <code class="filename">/etc</code>, <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${PREFIX}/etc</code> although it may + be overridden by the user to point to his + preferred location (e.g., <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/pkg</code>, etc.). Packages must not use it directly.</p> </li> @@ -8322,15 +9050,19 @@ SUPPORT_FILES_PERMS+= ${PREFIX}/share/somefile ${VARBASE}/somefile ${ROOT_USER} configuration files for the package being built shall be installed. The definition of this variable only makes sense in the package's - <code class="filename">Makefile</code> (i.e., it - is not user customizable).</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code> (i.e., it is not user + customizable).</p> <p>As an example, consider the Apache package, <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/apache2/README.html" - class="pkgname">www/apache2</a>, which places its - configuration files under the <code class= + target="_top"><code xmlns="" class= + "filename">www/apache2</code></a>, which places + its configuration files under the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">httpd/</code> subdirectory of <code class="varname">PKG_SYSCONFBASE</code>. This should be set in the package Makefile.</p> @@ -8377,23 +9109,29 @@ SUPPORT_FILES_PERMS+= ${PREFIX}/share/somefile ${VARBASE}/somefile ${ROOT_USER} <li> <p>If the previous variable is not defined but <code class="varname">PKG_SYSCONFSUBDIR</code> is - set in the package's <code class= + set in the package's <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>, the resulting value - is <code class= + is <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR}</code>.</p> </li> <li> - <p>Otherwise, it is set to <code class= + <p>Otherwise, it is set to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PKG_SYSCONFBASE}</code>.</p> </li> </ol> </div> - <p>It is worth mentioning that <code class= + <p>It is worth mentioning that <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PKG_SYSCONFDIR}</code> is automatically - added to <code class="filename">OWN_DIRS</code>. See - <a href="#dirs-outside-prefix" title= + added to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">OWN_DIRS</code>. See <a href= + "#dirs-outside-prefix" title= "12.1.1. Directory manipulation">Section 12.1.1, “Directory manipulation”</a> what this means.</p> @@ -8442,7 +9180,8 @@ CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} <p>As said before, pkginstall automatically handles configuration files. This means that <span class= "strong"><strong>the packages themselves must not touch - the contents of <code class= + the contents of <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PKG_SYSCONFDIR}</code> directly</strong></span>. Bad news is that many software installation scripts will, out of the box, @@ -8451,16 +9190,20 @@ CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} <p>You must teach the package (usually by manually patching it) to install any configuration files under - the examples hierarchy, <code class= + the examples hierarchy, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">share/examples/${PKGBASE}/</code>. This way, - the <code class="filename">PLIST</code> registers them - and the administrator always has the original copies + the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code> registers them and the + administrator always has the original copies available.</p> <p>Once the required configuration files are in place (i.e., under the examples hierarchy), the pkginstall framework can use them as master copies during the - package installation to update what is in <code class= + package installation to update what is in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PKG_SYSCONFDIR}</code>. To achieve this, the variables <code class="varname">CONF_FILES</code> and <code class="varname">CONF_FILES_PERMS</code> are @@ -8471,7 +9214,8 @@ CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} example, taken from the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/mail/mutt/README.html" - class="pkgname">mail/mutt</a> package:</p> + target="_top"><code xmlns="" class= + "filename">mail/mutt</code></a> package:</p> <pre class="programlisting"> EGDIR= ${PREFIX}/share/doc/mutt/samples CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc @@ -8528,14 +9272,17 @@ CONF_FILES= ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc <div class="orderedlist"> <ol type="1"> <li> - <p>Store the script inside <code class= + <p>Store the script inside <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${FILESDIR}</code>, with the <code class="literal">.sh</code> suffix appended. Considering the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/cups/README.html" - class="pkgname">print/cups</a> package as an - example, it has a <code class= + target="_top"><code xmlns="" class= + "filename">print/cups</code></a> package as an + example, it has a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">cupsd.sh</code> in its files directory.</p> </li> @@ -8560,16 +9307,19 @@ RCD_SCRIPTS+= cupsd <li> <p>Process the file found in the files directory applying all the substitutions described in the - <code class="filename">FILES_SUBST</code> - variable.</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">FILES_SUBST</code> variable.</p> </li> <li> <p>Copy the script from the files directory to the - examples hierarchy, <code class= + examples hierarchy, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}/share/examples/rc.d/</code>. Note that this master file must be explicitly - registered in the <code class= + registered in the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code>.</p> </li> @@ -8596,7 +9346,8 @@ RCD_SCRIPTS+= cupsd by setting the environment variable <code class= "varname">PKG_RCD_SCRIPTS</code> prior to package installation. Note that the scripts will be always - copied inside the examples hierarchy, <code class= + copied inside the examples hierarchy, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}/share/examples/rc.d/</code>, no matter what the value of this variable is.</p> </div> @@ -8619,7 +9370,8 @@ RCD_SCRIPTS+= cupsd <p>Users can be created by adding entries to the <code class="varname">PKG_USERS</code> variable. Each - entry has the following syntax, which mimics <code class= + entry has the following syntax, which mimics <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/passwd</code>:</p> <pre class="programlisting"> user:group[:[userid][:[descr][:[home][:shell]]]] @@ -8628,12 +9380,14 @@ user:group[:[userid][:[descr][:[home][:shell]]]] <p>Only the user and group are required; everything else is optional, but the colons must be in the right places when specifying optional bits. By default, a new user - will have home directory <code class= + will have home directory <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/nonexistent</code>, and login shell - <code class="filename">/sbin/nologin</code> unless they - are specified as part of the user element. Note that if - the description contains spaces, then spaces should be - double backslash-escaped, as in:</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/sbin/nologin</code> unless they are + specified as part of the user element. Note that if the + description contains spaces, then spaces should be double + backslash-escaped, as in:</p> <pre class="programlisting"> foo:foogrp::The\\ Foomister </pre> @@ -8660,7 +9414,8 @@ group[:groupid] </div> <p>Packages that install system shells should register - them in the shell database, <code class= + them in the shell database, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/shells</code>, to make things easier to the administrator. This must be done from the installation scripts to keep binary packages working on @@ -8674,7 +9429,8 @@ group[:groupid] following example, taken from <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/shells/zsh/README.html" - class="pkgname">shells/zsh</a>:</p> + target="_top"><code xmlns="" class= + "filename">shells/zsh</code></a>:</p> <pre class="programlisting"> USE_PKGINSTALL= YES PKG_SHELL= ${PREFIX}/bin/zsh @@ -8693,9 +9449,9 @@ PKG_SHELL= ${PREFIX}/bin/zsh <p>The automatic registration of shell interpreters can be disabled by the administrator by setting the - <code class="filename">PKG_REGISTER_SHELLS</code> - environment variable to <code class= - "literal">NO</code>.</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">PKG_REGISTER_SHELLS</code> environment + variable to <code class="literal">NO</code>.</p> </div> </div> </div> @@ -8721,13 +9477,15 @@ PKG_SHELL= ${PREFIX}/bin/zsh <dt><span class="sect1"><a href= "#converting-to-options">13.2. Converting packages to - use <code class= + use <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.options.mk</code></a></span></dt> </dl> </div> <p>Many packages have the ability to be built to support - different sets of features. <code class= + different sets of features. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.options.mk</code> is a framework in pkgsrc that provides generic handling of those options that determine different ways in which the packages can be @@ -8751,7 +9509,8 @@ PKG_SHELL= ${PREFIX}/bin/zsh "varname">PKG_DEFAULT_OPTIONS</code>, which is a list of the options that should be built into every package if that option is supported. This variable should be set in - <code class="filename">/etc/mk.conf</code>.</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/etc/mk.conf</code>.</p> </div> <div class="sect1" lang="en" xml:lang="en"> @@ -8761,18 +9520,23 @@ PKG_SHELL= ${PREFIX}/bin/zsh <h2 class="title" style="clear: both"><a name= "converting-to-options" id= "converting-to-options"></a>13.2. Converting - packages to use <code class= + packages to use <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.options.mk</code></h2> </div> </div> </div> - <p>The following example shows how <code class= + <p>The following example shows how <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.options.mk</code> should be used by the hypothetical ``wibble'' package, either in the package - <code class="filename">Makefile</code>, or in a file, - e.g. <code class="filename">options.mk</code>, that is - included by the main package <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">Makefile</code>, or in a file, e.g. + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">options.mk</code>, that is included by + the main package <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>.</p> <pre class="programlisting"> PKG_OPTIONS_VAR= PKG_OPTIONS.wibble @@ -8895,7 +9659,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} of “<span class="quote"><em class= "replaceable"><code>USE_VARIABLE</code></em>:<em class="replaceable"> <code>option</code></em></span>” pairs that - map legacy <code class= + map legacy <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> variables to their option counterparts. Pairs should be added with “<span class="quote">+=</span>” to keep @@ -8947,7 +9712,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} "varname">PKG_SUGGESTED_OPTIONS</code>.</p> <p><code class="varname">PKG_OPTIONS_VAR</code> must be - defined before including <code class= + defined before including <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.options.mk</code>. If none of <code class= "varname">PKG_SUPPORTED_OPTIONS</code>, <code class= "varname">PKG_OPTIONS_OPTIONAL_GROUPS</code>, and @@ -8958,7 +9724,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} empty list and the package is otherwise treated as not using the options framework.</p> - <p>After the inclusion of <code class= + <p>After the inclusion of <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">bsd.options.mk</code>, the variable <code class="varname">PKG_OPTIONS</code> contains the list of selected build options, properly filtered to @@ -8980,7 +9747,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} For options specific to this package, prefix the name with <code class="varname"><em class= "replaceable"><code>pkgname</code></em>-</code>. Document - the option and its meaning in <code class= + the option and its meaning in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">mk/defaults/options.description</code>.</p> </div> </div> @@ -9021,7 +9789,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} the generated binaries, etc. can be put into place on the system. These are exactly the steps performed by the NetBSD package system, which is implemented as a series of targets - in a central Makefile, <code class= + in a central Makefile, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/mk/bsd.pkg.mk</code>.</p> <div class="sect1" lang="en" xml:lang="en"> @@ -9043,7 +9812,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} <p>The automatic variable <code class= "varname">PREFIX</code> indicates where all files of the final program shall be installed. It is usually set to - <code class="varname">LOCALBASE</code> (<code class= + <code class="varname">LOCALBASE</code> (<code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkg</code>), or <code class= "varname">CROSSBASE</code> for pkgs in the “<span class="quote">cross</span>” category. @@ -9099,7 +9869,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} <p>Usually, X11 packages should be installed under <code class="varname">LOCALBASE</code> whenever possible. Note that you will need to include - <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">../../mk/x11.buildlink3.mk</code> in them to request the presence of X11 and to get the right compilation flags.</p> @@ -9118,16 +9889,20 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} libraries installed by a pkg that has <code class= "varname">USE_IMAKE</code> or <code class= "varname">USE_X11BASE</code> in its pkg - <code class="filename">Makefile</code>, you need to - look in <span class="emphasis"><em>both</em></span> - <code class="filename">${X11BASE}</code> and - <code class="filename">${LOCALBASE}</code>. To - force installation of all X11 packages in - <code class="varname">LOCALBASE</code>, the - <a xmlns="http://www.w3.org/TR/xhtml1/transitional" - href= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">Makefile</code>, you need to look + in <span class="emphasis"><em>both</em></span> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${X11BASE}</code> and <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${LOCALBASE}</code>. To force + installation of all X11 packages in <code class= + "varname">LOCALBASE</code>, the <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/xpkgwedge/README.html" - class="pkgname">pkgtools/xpkgwedge</a> package is + target="_top"><code xmlns="" class= + "filename">pkgtools/xpkgwedge</code></a> package is enabled by default.</p> </li> @@ -9163,7 +9938,8 @@ CONFIGURE_ARGS+= --enable-ldap=${BUILDLINK_PREFIX.openldap} <p>This is best illustrated by example.</p> - <p>The following lines are taken from <code class= + <p>The following lines are taken from <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/wm/scwm/Makefile</code>:</p> <pre class="programlisting"> EVAL_PREFIX+= GTKDIR=gtk+ @@ -9186,13 +9962,17 @@ GTKDIR_DEFAULT= ${LOCALBASE} </li> <li> - <p>Within <code class="filename">${PREFIX}</code>, - packages should install files according to <a href= + <p>Within <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${PREFIX}</code>, packages should + install files according to <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?hier+7+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">hier</span>(7)</span></a>, with the - exception that manual pages go into <code class= - "filename">${PREFIX}/man</code>, not <code class= + exception that manual pages go into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">${PREFIX}/man</code>, not <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}/share/man</code>.</p> </li> </ul> @@ -9211,7 +9991,8 @@ GTKDIR_DEFAULT= ${LOCALBASE} </div> <p>The main targets used during the build process defined - in <code class="filename">bsd.pkg.mk</code> are:</p> + in <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">bsd.pkg.mk</code> are:</p> <div class="variablelist"> <dl> @@ -9222,7 +10003,8 @@ GTKDIR_DEFAULT= ${LOCALBASE} variables <code class="varname">DISTFILES</code> and <code class="varname">PATCHFILES</code> (as defined in the package's Makefile) are present on - the local system in <code class= + the local system in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/pkgsrc/distfiles</code>. If they are not present, an attempt will be made to fetch them using commands of the form:</p> @@ -9265,7 +10047,8 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} <p>When the distfiles are present on the local system, they need to be extracted, as they are usually in the form of some compressed archive - format, most commonly <code class= + format, most commonly <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.tar.gz</code>.</p> <p>If only some of the distfiles need to be @@ -9273,7 +10056,8 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} be put into <code class= "varname">EXTRACT_ONLY</code>.</p> - <p>If the distfiles are not in <code class= + <p>If the distfiles are not in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.tar.gz</code> format, they can be extracted by setting either <code class= "varname">EXTRACT_SUFX</code>, or <code class= @@ -9281,26 +10065,42 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} "varname">EXTRACT_BEFORE_ARGS</code> and <code class="varname">EXTRACT_AFTER_ARGS</code>. In the former case, pkgsrc knows how to extract a - number of suffixes (<code class= - "filename">.tar.gz</code>, <code class= - "filename">.tgz</code>, <code class= - "filename">.tar.gz2</code>, <code class= - "filename">.tbz</code>, <code class= - "filename">.tar.Z</code>, <code class= - "filename">.tar</code>, <code class= - "filename">.shar.gz</code>, <code class= - "filename">.shar.bz2</code>, <code class= - "filename">.shar.Z</code>, <code class= - "filename">.shar</code>, <code class= - "filename">.Z</code>, <code class= - "filename">.bz2</code> and <code class= + number of suffixes (<code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.tar.gz</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.tgz</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.tar.gz2</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.tbz</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.tar.Z</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.tar</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.shar.gz</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.shar.bz2</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.shar.Z</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.shar</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.Z</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.bz2</code> and <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.gz</code>; see the definition of the various <code class="varname">DECOMPRESS_CMD</code> - variables <code class="filename">bsd.pkg.mk</code> - for a complete list). Here's an example on how to - use the other variables for a program that comes - with a compressed shell archive whose name ends in - <code class="filename">.msg.gz</code>:</p> + variables <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">bsd.pkg.mk</code> for a complete list). + Here's an example on how to use the other variables + for a program that comes with a compressed shell + archive whose name ends in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.msg.gz</code>:</p> <pre class="programlisting"> EXTRACT_SUFX= .msg.gz EXTRACT_CMD= zcat @@ -9316,13 +10116,18 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} <code class="varname">PATCHFILES</code>, those present in the patches subdirectory of the package as well as in $LOCALPATCHES/$PKGPATH (e.g. - <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/local/patches/graphics/png</code>) - are applied. Patchfiles ending in <code class= - "filename">.Z</code> or <code class= + are applied. Patchfiles ending in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.Z</code> or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.gz</code> are uncompressed before they - are applied, files ending in <code class= - "filename">.orig</code> or <code class= + are applied, files ending in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.orig</code> or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.rej</code> are ignored. Any special options to <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?patch+1+NetBSD-current"> @@ -9373,7 +10178,8 @@ ${FETCH_CMD} ${FETCH_BEFORE_ARGS} ${site}${file} ${FETCH_AFTER_ARGS} from the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/sysutils/top/README.html" - class="pkgname">sysutils/top</a> package:</p> + target="_top"><code xmlns="" class= + "filename">sysutils/top</code></a> package:</p> <pre class="programlisting"> HAS_CONFIGURE= yes CONFIGURE_SCRIPT= Configure @@ -9535,8 +10341,10 @@ make build in by a given package, e.g. if <span><strong class="command">make deinstall DEINSTALLDEPENDS=1</strong></span> is done in - <code class="filename">pkgsrc/x11/kde</code>, - this is likely to remove whole KDE. Works by + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" + class="filename">pkgsrc/x11/kde</code>, this + is likely to remove whole KDE. Works by adding “<span class= "quote">-R</span>” to the <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?pkg_delete+1+NetBSD-current"> @@ -9588,7 +10396,8 @@ make build fail!</p> <p>The following variables can be used either on - the command line or in <code class= + the command line or in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> to alter the behaviour of <span><strong class="command">make update</strong></span>:</p> @@ -9706,7 +10515,8 @@ make build </pre> <p>The following variables can be used either on - the command line or in <code class= + the command line or in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> to alter the behaviour of <span><strong class="command">make clean-update</strong></span>:</p> @@ -9749,25 +10559,30 @@ make build <dt><span class="term">readme</span></dt> <dd> - <p>This target generates a <code class= + <p>This target generates a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">README.html</code> file, which can be viewed using a browser such as <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/mozilla/README.html" - class="pkgname">www/mozilla</a> or <a xmlns= + target="_top"><code xmlns="" class= + "filename">www/mozilla</code></a> or <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/links/README.html" - class="pkgname">www/links</a>. The generated files - contain references to any packages which are in the - <code class="varname">PACKAGES</code> directory on - the local host. The generated files can be made to - refer to URLs based on <code class= + target="_top"><code xmlns="" class= + "filename">www/links</code></a>. The generated + files contain references to any packages which are + in the <code class="varname">PACKAGES</code> + directory on the local host. The generated files + can be made to refer to URLs based on <code class= "varname">FTP_PKG_URL_HOST</code> and <code class= "varname">FTP_PKG_URL_DIR</code>. For example, if I - wanted to generate <code class= + wanted to generate <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">README.html</code> files which pointed to binary packages on the local machine, in the - directory <code class= + directory <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/usr/packages</code>, set <code class= "varname">FTP_PKG_URL_HOST=file://localhost</code> and <code class= @@ -9780,12 +10595,14 @@ make build <dt><span class="term">readme-all</span></dt> <dd> - <p>Use this target to create a file <code class= + <p>Use this target to create a file <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">README-all.html</code> which contains a list of all packages currently available in the NetBSD Packages Collection, together with the category they belong to and a short description. - This file is compiled from the <code class= + This file is compiled from the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/*/README.html</code> files, so be sure to run this <span class= "emphasis"><em>after</em></span> a @@ -9800,7 +10617,8 @@ make build “<span class="quote">readme</span>” target (see above), but is to be used when generating a pkgsrc tree to be written to a CD-ROM. - This target also produces <code class= + This target also produces <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">README.html</code> files, and can be made to refer to URLs based on <code class= "varname">CDROM_PKG_URL_HOST</code> and @@ -9813,7 +10631,8 @@ make build <p>This target shows which distfiles and patchfiles are needed to build the package. (<code class= "varname">DISTFILES</code> and <code class= - "varname">PATCHFILES</code>, but not <code class= + "varname">PATCHFILES</code>, but not <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">patches/*</code>)</p> </dd> @@ -9863,7 +10682,9 @@ make build see if they find the shared libs they need. Run by default if <code class= "varname">PKG_DEVELOPER</code> is set in - <code class="filename">/etc/mk.conf</code>.</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/mk.conf</code>.</p> </dd> <dt><span class="term">print-PLIST</span></dt> @@ -9872,15 +10693,20 @@ make build <p>After a “<span class="quote">make install</span>” from a new or upgraded pkg, this prints out an attempt to generate a new - <code class="filename">PLIST</code> from a - <span><strong class="command">find -newer + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code> from a <span><strong class= + "command">find -newer work/.extract_done</strong></span>. An attempt is made to care for shared libs etc., but it is <span class="emphasis"><em>strongly</em></span> recommended to review the result before putting it - into <code class="filename">PLIST</code>. On - upgrades, it's useful to diff the output of this - command against an already existing <code class= + into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code>. On upgrades, it's useful + to diff the output of this command against an + already existing <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code> file.</p> <p>If the package installs files via <a href= @@ -9889,10 +10715,11 @@ make build "refentrytitle">tar</span>(1)</span></a> or other methods that don't update file access times, be sure to add these files manually to your - <code class="filename">PLIST</code>, as the - “<span class="quote">find - -newer</span>” command used by this target - won't catch them!</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code>, as the “<span class= + "quote">find -newer</span>” command used by + this target won't catch them!</p> <p>See <a href="#print-PLIST" title= "10.3. Tweaking output of make print-PLIST">Section 10.3, @@ -9946,8 +10773,9 @@ make build <div class="itemizedlist"> <ul type="disc"> <li> - <p>None of the package's files (<code class= - "filename">Makefile</code>, ...) were + <p>None of the package's files (<code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" + class="filename">Makefile</code>, ...) were modified since it was built.</p> </li> @@ -10187,27 +11015,32 @@ make build <p>The problem with package-defined variables that can be overridden via <code class="varname">MAKECONF</code> - or <code class="filename">/etc/mk.conf</code> is that - <a href= + or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/mk.conf</code> is that <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?make+1+NetBSD-current"> <span class="citerefentry"><span class= "refentrytitle">make</span>(1)</span></a> expands a variable as it is used, but evaluates preprocessor like statements (.if, .ifdef and .ifndef) as they are read. So, to use any variable (which may be set in - <code class="filename">/etc/mk.conf</code>) in one of - the .if* statements, the file <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/etc/mk.conf</code>) in one of the + .if* statements, the file <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> must be included before that .if* statement.</p> <p>Rather than have a number of ad-hoc ways of - including <code class="filename">/etc/mk.conf</code>, - should it exist, or <code class= - "varname">MAKECONF</code>, should it exist, include the - <code class="filename">pkgsrc/mk/bsd.prefs.mk</code> - file in the package Makefile before any - preprocessor-like .if, .ifdef, or .ifndef - statements:</p> + including <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/mk.conf</code>, should it exist, or + <code class="varname">MAKECONF</code>, should it exist, + include the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">pkgsrc/mk/bsd.prefs.mk</code> file in the + package Makefile before any preprocessor-like .if, + .ifdef, or .ifndef statements:</p> <pre class="programlisting"> .include "../../mk/bsd.prefs.mk" @@ -10217,7 +11050,8 @@ make build </pre> <p>If you wish to set the <code class= - "varname">CFLAGS</code> variable in <code class= + "varname">CFLAGS</code> variable in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code> please make sure to use:</p> <pre class="programlisting"> @@ -10231,7 +11065,8 @@ CFLAGS+= -your -flags the <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/cpuflags/README.html" - class="pkgname">devel/cpuflags</a> package if you're + target="_top"><code xmlns="" class= + "filename">devel/cpuflags</code></a> package if you're interested in optimization for the current CPU.</p> </div> @@ -10247,11 +11082,13 @@ CFLAGS+= -your -flags </div> </div> - <p>Documentation should be installed into <code class= + <p>Documentation should be installed into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}/share/doc/${PKGBASE}</code> or - <code class= - "filename">${PREFIX}/share/doc/${PKGNAME}</code> (the - latter includes the version number of the package).</p> + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">${PREFIX}/share/doc/${PKGNAME}</code> + (the latter includes the version number of the + package).</p> </div> <div class="sect2" lang="en" xml:lang="en"> @@ -10350,7 +11187,8 @@ CFLAGS+= -your -flags dependency. pkgsrc supports the <code class= "varname">BUILD_DEPENDS</code> and <code class= "varname">DEPENDS</code> definitions, as well as - dependencies via <code class= + dependencies via <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code>, which is the preferred way to handle dependencies, and which uses the variables named above. See <a href="#buildlink" title= @@ -10391,7 +11229,8 @@ CFLAGS+= -your -flags <li> <p>If your package needs another package's binaries or libraries to build or run, and if - that package has a <code class= + that package has a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file available, use it:</p> <pre class="programlisting"> @@ -10402,7 +11241,8 @@ CFLAGS+= -your -flags <li> <p>If your package needs to use another package - to build itself and there is no <code class= + to build itself and there is no <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file available, use the <code class= "varname">BUILD_DEPENDS</code> definition:</p> @@ -10413,15 +11253,17 @@ BUILD_DEPENDS+= autoconf-2.13:../../devel/autoconf <li> <p>If your package needs a library with which to - link and again there is no <code class= + link and again there is no <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file available, this is specified using the <code class= "varname">DEPENDS</code> definition. An example of this is the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/lyx/README.html" - class="pkgname">print/lyx</a> package, which uses - the xpm library, version 3.4j to build:</p> + target="_top"><code xmlns="" class= + "filename">print/lyx</code></a> package, which + uses the xpm library, version 3.4j to build:</p> <pre class="programlisting"> DEPENDS+= xpm-3.4j:../../graphics/xpm </pre> @@ -10515,14 +11357,18 @@ RECOMMENDED+= tiff>=3.6.1:../../graphics/tiff <li> <p>If your package needs some executable to be able to run correctly and if there's no - <code class="filename">buildlink3.mk</code> file, - this is specified using the <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">buildlink3.mk</code> file, this is + specified using the <code class= "varname">DEPENDS</code> variable. The <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/lyx/README.html" - class="pkgname">print/lyx</a> package needs to be - able to execute the latex binary from the teTeX - package when it runs, and that is specified:</p> + target="_top"><code xmlns="" class= + "filename">print/lyx</code></a> package needs to + be able to execute the latex binary from the + teTeX package when it runs, and that is + specified:</p> <pre class="programlisting"> DEPENDS+= teTeX-[0-9]*:../../print/teTeX </pre> @@ -10538,7 +11384,8 @@ DEPENDS+= teTeX-[0-9]*:../../print/teTeX "quote">do-configure</span>” target <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/print/ghostscript5/README.html" - class="pkgname">print/ghostscript5</a> package (it + target="_top"><code xmlns="" class= + "filename">print/ghostscript5</code></a> package (it relies on the jpeg sources being present in source form during the build):</p> <pre class="programlisting"> @@ -10568,13 +11415,15 @@ pre-clean: <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/gettext/README.html" - class="pkgname">devel/gettext</a> package. The latter + target="_top"><code xmlns="" class= + "filename">devel/gettext</code></a> package. The latter adds a build dependency on either an installed version of an older gettext package, or if it isn't, installs the <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/gettext-m4/README.html" - class="pkgname">devel/gettext-m4</a> package.</p> + target="_top"><code xmlns="" class= + "filename">devel/gettext-m4</code></a> package.</p> </div> <div class="sect2" lang="en" xml:lang="en"> @@ -10601,17 +11450,21 @@ pre-clean: <p>For example <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/Xaw3d/README.html" - class="pkgname">x11/Xaw3d</a> and <a xmlns= + target="_top"><code xmlns="" class= + "filename">x11/Xaw3d</code></a> and <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/x11/Xaw-Xpm/README.html" - class="pkgname">x11/Xaw-Xpm</a> install provide the - same shared library, thus you set in <code class= + target="_top"><code xmlns="" class= + "filename">x11/Xaw-Xpm</code></a> install provide the + same shared library, thus you set in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/x11/Xaw3d/Makefile</code>:</p> <pre class="programlisting"> CONFLICTS= Xaw-Xpm-[0-9]* </pre> - <p>and in <code class= + <p>and in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/x11/Xaw-Xpm/Makefile</code>:</p> <pre class="programlisting"> CONFLICTS= Xaw3d-[0-9]* @@ -10644,18 +11497,19 @@ CONFLICTS= Xaw3d-[0-9]* "varname">NOT_FOR_PLATFORM</code>. If the package builds and runs on a small handful of platforms, set <code class="varname">ONLY_FOR_PLATFORM</code> instead. - If the package should be skipped (for example, because - it provides functionality already provided by the - system), set <code class= + Both <code class="varname">ONLY_FOR_PLATFORM</code> and + <code class="varname">NOT_FOR_PLATFORM</code> are OS + triples (OS-version-platform) that can use glob-style + wildcards.</p> + + <p>If the package should be skipped (for example, + because it provides functionality already provided by + the system), set <code class= "varname">PKG_SKIP_REASON</code> to a descriptive message. If the package should fail because some preconditions are not met, set <code class= "varname">PKG_FAIL_REASON</code> to a descriptive message.</p> - - <p><code class="varname">IGNORE</code> is deprecated - because it didn't provide enough information to - determine whether the build should fail.</p> </div> <div class="sect2" lang="en" xml:lang="en"> @@ -10696,7 +11550,8 @@ CONFLICTS= Xaw3d-[0-9]* </div> <p>When a vulnerability is found, this should be noted - in <code class= + in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">localsrc/security/advisories/pkg-vulnerabilities</code>, and after committing that file, use <span><strong class="command">make @@ -10707,7 +11562,8 @@ CONFLICTS= Xaw3d-[0-9]* <code class="varname">PKGREVISION</code> should be increased (this is of course not necessary if the problem is fixed by using a newer release of the - software). In addition, if a <code class= + software). In addition, if a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file exists for an affected package, a corresponding <code class= "varname">BUILDLINK_RECOMMENDED.<em class= @@ -10742,7 +11598,8 @@ CONFLICTS= Xaw3d-[0-9]* <code class="varname">MACHINE_ARCH</code> and compiler version, disabling optimisation for that file/<code class="varname">MACHINE_ARCH</code>/compiler - combination, and documenting it in <code class= + combination, and documenting it in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/doc/HACKS</code>. See that file for a number of examples!</p> </div> @@ -10858,15 +11715,17 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 <p>If you need to download from a dynamic URL you can set <code class="varname">DYNAMIC_MASTER_SITES</code> and a <span><strong class="command">make - fetch</strong></span> will call <code class= + fetch</strong></span> will call <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">files/getsite.sh</code> with the name of each file to download as an argument, expecting it to output the URL of the directory from which to download it. <a xmlns="http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/graphics/ns-cult3d/README.html" - class="pkgname">graphics/ns-cult3d</a> is an example of - this usage.</p> + target="_top"><code xmlns="" class= + "filename">graphics/ns-cult3d</code></a> is an example + of this usage.</p> <p>If the download can't be automated, because the user must submit personal information to apply for a @@ -10880,28 +11739,38 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 following packages use this: <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/cad/simian/README.html" - class="pkgname">cad/simian</a>, <a xmlns= + target="_top"><code xmlns="" class= + "filename">cad/simian</code></a>, <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/ipv6socket/README.html" - class="pkgname">devel/ipv6socket</a>, <a xmlns= + target="_top"><code xmlns="" class= + "filename">devel/ipv6socket</code></a>, <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/emulators/vmware-module/README.html" - class="pkgname">emulators/vmware-module</a>, <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= + target="_top"><code xmlns="" class= + "filename">emulators/vmware-module</code></a>, + <a xmlns="http://www.w3.org/TR/xhtml1/transitional" + href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/fonts/acroread-jpnfont/README.html" - class="pkgname">fonts/acroread-jpnfont</a>, <a xmlns= + target="_top"><code xmlns="" class= + "filename">fonts/acroread-jpnfont</code></a>, <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/multimedia/realplayer/README.html" - class="pkgname">multimedia/realplayer</a>, <a xmlns= + target="_top"><code xmlns="" class= + "filename">multimedia/realplayer</code></a>, <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/sysutils/storage-manager/README.html" - class="pkgname">sysutils/storage-manager</a>, <a xmlns= - "http://www.w3.org/TR/xhtml1/transitional" href= + target="_top"><code xmlns="" class= + "filename">sysutils/storage-manager</code></a>, + <a xmlns="http://www.w3.org/TR/xhtml1/transitional" + href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/ap-aolserver/README.html" - class="pkgname">www/ap-aolserver</a>, <a xmlns= + target="_top"><code xmlns="" class= + "filename">www/ap-aolserver</code></a>, <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/www/openacs/README.html" - class="pkgname">www/openacs</a>. Try to be consistent + target="_top"><code xmlns="" class= + "filename">www/openacs</code></a>. Try to be consistent with them.</p> </div> @@ -10932,11 +11801,13 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 name, usually based on <code class= "varname">PKGNAME_NOREV</code>. In case this happens more often, <code class="varname">PKGNAME</code> can be - used (thus including the <code class= + used (thus including the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">nbX</code> suffix) or a date stamp can be appended, like <code class= "varname">${PKGNAME_NOREV}-YYYYMMDD</code>. Do not - forget regenerating the <code class= + forget regenerating the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">distinfo</code> file after that, since it contains the <code class="varname">DIST_SUBDIR</code> path in the filenames. Furthermore, a mail to the @@ -10979,11 +11850,12 @@ ${INSTALL_DATA_DIR} ${PREFIX}/dir2 hand to test things. The <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/libtool/README.html" - class="pkgname">devel/libtool</a> pkg can help here, as - it just “<span class="quote">knows</span>” - how to build both static and dynamic libraries from a - set of source files, thus being platform - independent.</p> + target="_top"><code xmlns="" class= + "filename">devel/libtool</code></a> pkg can help here, + as it just “<span class= + "quote">knows</span>” how to build both static + and dynamic libraries from a set of source files, thus + being platform independent.</p> <p>Here's how to use libtool in a pkg in seven simple steps:</p> @@ -11021,12 +11893,17 @@ ${LIBTOOL} --mode=link ${CC} -o ${.TARGET:.a=.la} ${OBJS:.o=.lo} -rpath ${PREFIX </pre> <p>Note that the library is changed to have a - <code class="filename">.la</code> extension, and - the objects are changed to have a <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.la</code> extension, and the objects + are changed to have a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.lo</code> extension. Change <code class="varname">OBJS</code> as necessary. This automatically creates all of the - <code class="filename">.a</code>, <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">.a</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.so.major.minor</code>, and ELF symlinks (if necessary) in the build directory. Be sure to include “<span class= @@ -11074,14 +11951,18 @@ dynamic linker chooses the library with the greater REVISION number. argument</span>” is the install directory of the library being built.</p> - <p>In the <code class="filename">PLIST</code>, - include only the <code class= + <p>In the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code>, include only the + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.la</code> file, the other files will be added automatically.</p> </li> <li> - <p>When linking shared object (<code class= + <p>When linking shared object (<code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.so</code>) files, i.e. files that are loaded via <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?dlopen+3+NetBSD-current"> @@ -11091,9 +11972,11 @@ dynamic linker chooses the library with the greater REVISION number. "quote">-module -avoid-version</span>” to prevent them getting version tacked on.</p> - <p>The <code class="filename">PLIST</code> file - gets the <code class="filename">foo.so</code> - entry.</p> + <p>The <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code> file gets the + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">foo.so</code> entry.</p> </li> <li> @@ -11116,7 +11999,9 @@ dynamic linker chooses the library with the greater REVISION number. “<span class= "quote">-L../somelib</span>”), because it expects you to change that argument to be the - <code class="filename">.la</code> file. e.g.</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.la</code> file. e.g.</p> <pre class="programlisting"> ${LIBTOOL} --mode=link ${CC} -o someprog -L../somelib -lsomelib </pre> @@ -11143,13 +12028,15 @@ ${LIBTOOL} --mode=link ${CC} -o <em class= "refentrytitle">cp</span>(1)</span></a> command with “<span class="quote">${LIBTOOL} --mode=install</span>”, and change the - library name to <code class= + library name to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.la</code>. e.g.</p> <pre class="programlisting"> ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib </pre> - <p>This will install the static <code class= + <p>This will install the static <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.a</code>, shared library, any needed symlinks, and run <a href= "http://netbsd.gw.com/cgi-bin/man-cgi?ldconfig+8+NetBSD-current"> @@ -11158,8 +12045,11 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib </li> <li> - <p>In your <code class="filename">PLIST</code>, - include only the <code class= + <p>In your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code>, include only the + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.la</code> file (this is a change from previous behaviour).</p> </li> @@ -11195,10 +12085,11 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib this does not match the location of the package's libtool script(s), set it as appropriate.</p> - <p>If you do not need <code class="filename">*.a</code> - static libraries built and installed, then use - <code class="varname">SHLIBTOOL_OVERRIDE</code> - instead.</p> + <p>If you do not need <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">*.a</code> static libraries built and + installed, then use <code class= + "varname">SHLIBTOOL_OVERRIDE</code> instead.</p> <p>If your package makes use of the platform independent library for loading dynamic shared objects, @@ -11221,9 +12112,12 @@ ${LIBTOOL} --mode=install ${BSD_INSTALL_DATA} ${SOMELIB:.a=.la} ${PREFIX}/lib <ol type="1"> <li> <p>The shared object is named correctly, - i.e. <code class= - "filename">libfoo.la</code>, not - <code class="filename">foo.la</code></p> + i.e. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" + class="filename">libfoo.la</code>, not + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" + class="filename">foo.la</code></p> </li> <li> @@ -11332,7 +12226,8 @@ pre-configure: <p>To test whether you are working on a 4.4 BSD-derived system, you should use the BSD definition, which is - defined in <code class= + defined in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename"><sys/param.h></code> on said systems.</p> <pre class="programlisting"> @@ -11404,7 +12299,8 @@ pre-configure: <p>The <code class="varname">INTERACTIVE_STAGE</code> definition is provided to notify the pkgsrc mechanism of an interactive stage which will be needed, and this - should be set in the package's <code class= + should be set in the package's <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>. e.g.</p> <pre class="programlisting"> INTERACTIVE_STAGE= build @@ -11454,13 +12350,15 @@ INTERACTIVE_STAGE= configure install restrictions should have tags.</p> <p>Denoting that a package is covered by a particular - license is done by placing the license in <code class= + license is done by placing the license in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/licenses</code> and setting the <code class="varname">LICENSE</code> variable to a string identifying the license, e.g. in <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/graphics/xv/README.html" - class="pkgname">graphics/xv</a>:</p> + target="_top"><code xmlns="" class= + "filename">graphics/xv</code></a>:</p> <pre class="programlisting"> LICENSE= xv-license </pre> @@ -11481,19 +12379,23 @@ LICENSE= xv-license <p>The license can be viewed with <span><strong class= "command">make show-license</strong></span>, and if it is considered appropriate, the line printed above can - be added to <code class="filename">/etc/mk.conf</code> - to indicate acceptance of the particular license:</p> + be added to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">/etc/mk.conf</code> to indicate acceptance + of the particular license:</p> <pre class="programlisting"> ACCEPTABLE_LICENSES+=xv-license </pre> <p>When adding a package with a new license, the - license text should be added to <code class= + license text should be added to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/licenses</code> for displaying. A list of known licenses can be seen in this directory as well as by looking at the list of (commented out) <code class="varname">ACCEPTABLE_LICENSES</code> - variable settings in <code class= + variable settings in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/mk/defaults/mk.conf</code>.</p> <p>The use of <code class= @@ -11528,8 +12430,9 @@ ACCEPTABLE_LICENSES+=xv-license and the score files owned by the appropriate group and/or owner (traditionally the "games" user/group). The following variables, documented in more detail in - <code class="filename">mk/defaults/mk.conf</code>, - control this behaviour: <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">mk/defaults/mk.conf</code>, control + this behaviour: <code class= "varname">SETGIDGAME</code>, <code class= "varname">GAMEDATAMODE</code>, <code class= "varname">GAMEGRP</code>, <code class= @@ -11582,9 +12485,11 @@ ACCEPTABLE_LICENSES+=xv-license paths to other interpreters besides (or as well as) perl. To correct the full pathname to the script interpreter, you need to set the following definitions - in your <code class="filename">Makefile</code> (we - shall use <span><strong class= - "command">tclsh</strong></span> in this example):</p> + in your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code> (we shall use + <span><strong class="command">tclsh</strong></span> in + this example):</p> <pre class="programlisting"> REPLACE_INTERPRETER+= tcl _REPLACE.tcl.old= .*/bin/tclsh @@ -11606,7 +12511,8 @@ ACCEPTABLE_LICENSES+=xv-license </div> <p>Makefiles of packages providing perl5 modules should - include the Makefile fragment <code class= + include the Makefile fragment <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">../../lang/perl5/module.mk</code>. It provides a <span><strong class= "command">do-configure</strong></span> target for the @@ -11617,8 +12523,11 @@ ACCEPTABLE_LICENSES+=xv-license <p>Perl5 modules will install into different places depending on the version of perl used during the build process. To address this, pkgsrc will append lines to - the <code class="filename">PLIST</code> corresponding - to the files listed in the installed <code class= + the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code> corresponding to the files + listed in the installed <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.packlist</code> file generated by most perl5 modules. This is invoked by defining <code class= "varname">PERL5_PACKLIST</code> to a space-separated @@ -11634,7 +12543,9 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist locations in which perl5 modules may be installed, and may be used by perl5 packages that don't have a packlist. These three variables are also substituted - for in the <code class="filename">PLIST</code>.</p> + for in the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code>.</p> </div> <div class="sect2" lang="en" xml:lang="en"> @@ -11657,13 +12568,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <ul type="disc"> <li> <p>is considered to be installed in the directory - <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}/${INFO_DIR}</code>,</p> </li> <li> <p>is registered in the Info directory file - <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}/${INFO_DIR}/dir</code>,</p> </li> @@ -11677,8 +12590,10 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p><code class="varname">INFO_DIR</code> defaults to “<span class="quote">info</span>” and can - be overridden in the package Makefile. <code class= - "filename">INSTALL</code> and <code class= + be overridden in the package Makefile. <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">INSTALL</code> and <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">DEINSTALL</code> scripts will be generated to handle registration of the info files in the Info directory file. The “<span class= @@ -11695,15 +12610,17 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist "quote">makeinfo</span>” command is needed it should be noted with the <code class= "varname">TEXINFO_REQD</code> variable in the package - <code class="filename">Makefile</code>. By default, a - minimum version of 3.12 is required. If the system does - not provide a <span><strong class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">Makefile</code>. By default, a minimum + version of 3.12 is required. If the system does not + provide a <span><strong class= "command">makeinfo</strong></span> command or if it does not match the required minimum, a build dependency on the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/devel/gtexinfo/README.html" - class="pkgname">devel/gtexinfo</a> package will be + target="_top"><code xmlns="" class= + "filename">devel/gtexinfo</code></a> package will be added automatically.</p> <p>The build and installation process of the software @@ -11711,8 +12628,9 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <span><strong class= "command">install-info</strong></span> command as the registration of info files is the task of the package - <code class="filename">INSTALL</code> script, and it - must use the appropriate <span><strong class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">INSTALL</code> script, and it must use + the appropriate <span><strong class= "command">makeinfo</strong></span> command.</p> <p>To achieve this goal the pkgsrc infrastructure @@ -11745,8 +12663,10 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </div> </div> - <p>If a package installs <code class= - "filename">.schemas</code> or <code class= + <p>If a package installs <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.schemas</code> or <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.entries</code> files, used by GConf2, you need to take some extra steps to make sure they get registered in the database:</p> @@ -11754,9 +12674,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="orderedlist"> <ol type="1"> <li> - <p>Include <code class= + <p>Include <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">../../devel/GConf2/schemas.mk</code> - instead of its <code class= + instead of its <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file. This takes care of rebuilding the GConf2 database at installation and deinstallation time, and tells @@ -11768,10 +12690,14 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <li> <p>Ensure that the package installs its - <code class="filename">.schemas</code> files - under <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.schemas</code> files under + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}/share/gconf/schemas</code>. - If they get installed under <code class= + If they get installed under <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}/etc</code>, you will need to manually patch the package.</p> </li> @@ -11789,8 +12715,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <li> <p>Define the <code class= "varname">GCONF2_SCHEMAS</code> variable in your - <code class="filename">Makefile</code> with a - list of all <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code> with a list of all + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.schemas</code> files installed by the package, if any. Names must not contain any directories in them.</p> @@ -11799,8 +12728,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <li> <p>Define the <code class= "varname">GCONF2_ENTRIES</code> variable in your - <code class="filename">Makefile</code> with a - list of all <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code> with a list of all + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.entries</code> files installed by the package, if any. Names must not contain any directories in them.</p> @@ -11821,7 +12753,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </div> </div> - <p>If a package installs <code class= + <p>If a package installs <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">.omf</code> files, used by scrollkeeper, you need to take some extra steps to make sure they get registered in the database:</p> @@ -11829,9 +12762,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="orderedlist"> <ol type="1"> <li> - <p>Include <code class= + <p>Include <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">../../textproc/scrollkeeper/omf.mk</code> - instead of its <code class= + instead of its <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file. This takes care of rebuilding the scrollkeeper database at installation and deinstallation time, and @@ -11841,13 +12776,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <li> <p>Check the PLIST and remove any entries under - the <code class= + the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">libdata/scrollkeeper</code> directory, as they will be handled automatically.</p> </li> <li> - <p>Remove the <code class= + <p>Remove the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">share/omf</code> directory from the PLIST. It will be handled by scrollkeeper.</p> </li> @@ -11869,9 +12806,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p>If a package installs font files, you will need to rebuild the fonts database in the directory where they get installed at installation and deinstallation time. - This can be automatically done by using <code class= + This can be automatically done by using <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">mk/fonts.mk</code>, which you need to - include in your <code class= + include in your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>.</p> <p>When the file is included, you can list the @@ -11883,7 +12822,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist “<span class="quote">TTF</span>”, “<span class="quote">TYPE1</span>” or “<span class="quote">X11</span>”. Also make - sure that the database file <code class= + sure that the database file <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">fonts.dir</code> is not listed in the PLIST.</p> @@ -11911,9 +12851,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="orderedlist"> <ol type="1"> <li> - <p>Include <code class= + <p>Include <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">../../x11/gtk2/modules.mk</code> - instead of its <code class= + instead of its <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file. This takes care of rebuilding the database at installation and deinstallation time.</p> @@ -11938,12 +12880,16 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="itemizedlist"> <ul type="disc"> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" + class= "filename">libdata/gtk-2.0/gdk-pixbuf.loaders</code></p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" + class= "filename">libdata/gtk-2.0/gtk.immodules</code></p> </li> </ul> @@ -11952,9 +12898,10 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <li> <p>Check the PLIST and remove any entries under - the <code class="filename">libdata/gtk-2.0</code> - directory, as they will be handled - automatically.</p> + the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">libdata/gtk-2.0</code> directory, as + they will be handled automatically.</p> </li> </ol> </div> @@ -11979,12 +12926,14 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="orderedlist"> <ol type="1"> <li> - <p>Include <code class= + <p>Include <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">../../textproc/xmlcatmgr/catalogs.mk</code> - in your <code class="filename">Makefile</code>, - which takes care of registering those files in - system-wide catalogs at installation and - deinstallation time.</p> + in your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code>, which takes care of + registering those files in system-wide catalogs + at installation and deinstallation time.</p> </li> <li> @@ -12034,8 +12983,10 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </div> <p>If a package provides extensions to the MIME - database by installing <code class= - "filename">.xml</code> files inside <code class= + database by installing <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">.xml</code> files inside <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">${PREFIX}/share/mime/packages</code>, you need to take some extra steps to ensure that the database is kept consistent with respect to these new @@ -12044,12 +12995,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div class="orderedlist"> <ol type="1"> <li> - <p>Include <code class= + <p>Include <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">../../databases/shared-mime-info/mimedb.mk</code> - (avoid using the <code class= + (avoid using the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> file from this same directory, which is reserved for inclusion - from other <code class= + from other <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">buildlink3.mk</code> files). It takes care of rebuilding the MIME database at installation and deinstallation time, and @@ -12059,10 +13013,12 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <li> <p>Check the PLIST and remove any entries under - the <code class="filename">share/mime</code> - directory, <span class= - "emphasis"><em>except</em></span> for files saved - under <code class= + the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">share/mime</code> directory, + <span class="emphasis"><em>except</em></span> for + files saved under <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">share/mime/packages</code>. The former are handled automatically by the update-mime-database program, but the later are @@ -12072,7 +13028,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </li> <li> - <p>Remove any <code class= + <p>Remove any <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">share/mime/*</code> directories from the PLIST. They will be handled by the shared-mime-info package.</p> @@ -12093,7 +13050,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </div> <p>If a package uses intltool during its build, include - the <code class= + the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">../../textproc/intltool/buildlink3.mk</code> file, which forces it to use the intltool package provided by pkgsrc, instead of the one bundled with the @@ -12119,9 +13077,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p>If a package contains a rc.d script, it won't be copied into the startup directory by default, but you can enable it, by adding the option <code class= - "varname">PKG_RCD_SCRIPTS=YES</code> in <code class= + "varname">PKG_RCD_SCRIPTS=YES</code> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code>. This option will copy - the scripts into <code class= + the scripts into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/rc.d</code> when a package is installed, and it will automatically remove the scripts when the package is deinstalled.</p> @@ -12173,7 +13133,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <ul type="disc"> <li> <p>Be sure to set <code class= - "varname">PKG_DEVELOPER=1</code> in <code class= + "varname">PKG_DEVELOPER=1</code> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">/etc/mk.conf</code></p> </li> @@ -12181,7 +13142,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p>Install <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/url2pkg/README.html" - class="pkgname">pkgtools/url2pkg</a>, create a + target="_top"><code xmlns="" class= + "filename">pkgtools/url2pkg</code></a>, create a directory for a new package, change into it, then run <span><strong class= "command">url2pkg</strong></span>:</p> @@ -12200,13 +13162,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </li> <li> - <p>Edit the <code class="filename">Makefile</code> as - requested.</p> + <p>Edit the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code> as requested.</p> </li> <li> - <p>Fill in the <code class="filename">DESCR</code> - file</p> + <p>Fill in the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">DESCR</code> file</p> </li> <li> @@ -12216,7 +13180,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <li> <p>Add any dependencies glimpsed from documentation - and the configure step to the package's <code class= + and the configure step to the package's <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>.</p> </li> @@ -12250,20 +13215,24 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist are from the <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkgdiff/README.html" - class="pkgname">pkgtools/pkgdiff</a> package.</p> + target="_top"><code xmlns="" class= + "filename">pkgtools/pkgdiff</code></a> package.</p> </li> <li> - <p>Look at the <code class= + <p>Look at the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>, fix if necessary; see <a href="#components.Makefile" title= "8.1. Makefile">Section 8.1, - “<code class= + “<code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>”</a>.</p> </li> <li> - <p>Generate a <code class= + <p>Generate a <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code>:</p> <pre class="screen"> <code class="prompt">#</code> <strong class= @@ -12278,7 +13247,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist "userinput"><code>make deinstall</code></strong> </pre> - <p>You usually need to be <code class= + <p>You usually need to be <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "username">root</code> to do this. Look if there are any files left:</p> <pre class="screen"> @@ -12287,13 +13257,16 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </pre> <p>If this reveals any files that are missing in - <code class="filename">PLIST</code>, add them.</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code>, add them.</p> </li> <li> - <p>Now that the <code class="filename">PLIST</code> - is OK, install the package again and make a binary - package:</p> + <p>Now that the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">PLIST</code> is OK, install the package + again and make a binary package:</p> <pre class="screen"> <code class="prompt">#</code> <strong class= "userinput"><code>make reinstall</code></strong> @@ -12337,7 +13310,8 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist "command">pkglint</strong></span> from <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkglint/README.html" - class="pkgname">pkgtools/pkglint</a>, and fix the + target="_top"><code xmlns="" class= + "filename">pkgtools/pkglint</code></a>, and fix the problems it reports:</p> <pre class="screen"> <code class="prompt">#</code> <strong class= @@ -12475,24 +13449,28 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </div> <p>Please note all package additions, updates, moves, and - removals in <code class= + removals in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/doc/CHANGES</code>. It's very important to keep this file up to date and conforming to the existing format, because it will be used by scripts to automatically update pages on <a href= "http://www.NetBSD.org/" target="_top">www.NetBSD.org</a> - and other sites. Additionally, check the <code class= + and other sites. Additionally, check the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/doc/TODO</code> file and remove the entry for the package you updated or removed, in case it was mentioned there.</p> <p>There is a make target that helps in creating proper - <code class="filename">CHANGES</code> entries: + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">CHANGES</code> entries: <span><strong class="command">make changes-entry</strong></span>. It uses the optional <code class="varname">CTYPE</code> and <code class= "varname">NETBSD_LOGIN_NAME</code> variables. The general - usage is to first make sure that your <code class= + usage is to first make sure that your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">CHANGES</code> file is up-to-date (to avoid having to resolve conflicts later-on) and then to <span><strong class="command">cd</strong></span> to the @@ -12503,9 +13481,11 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <code class="varname">CTYPE</code> variable on the command line to "Added", "Moved", or "Removed". You can set <code class="varname">NETBSD_LOGIN_NAME</code> in - <code class="filename">/etc/mk.conf</code> if your local - login name is not the same as your NetBSD login name. - Don't forget to commit the changes to <code class= + <code xmlns="http://www.w3.org/TR/xhtml1/transitional" + class="filename">/etc/mk.conf</code> if your local login + name is not the same as your NetBSD login name. Don't + forget to commit the changes to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/doc/CHANGES</code>!</p> </div> @@ -12541,13 +13521,15 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist out of the way, or cvs will complain the next time you “<span class="quote">cvs update</span>” your source tree. Also don't forget to add the new package to - the category's <code class= + the category's <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">Makefile</code>.</p> <p>The commit message of the initial import should - include part of the <code class="filename">DESCR</code> - file, so people reading the mailing lists know what the - package is/does.</p> + include part of the <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">DESCR</code> file, so people reading the + mailing lists know what the package is/does.</p> <p>For new packages, “<span class="quote">cvs import</span>” is preferred to “<span class= @@ -12676,12 +13658,14 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist </li> <li> - <p>Remove from <code class= + <p>Remove from <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">oldcategory/Makefile</code>.</p> </li> <li> - <p>Add to <code class= + <p>Add to <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">newcategory/Makefile</code>.</p> </li> @@ -12705,7 +13689,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h2 class="title"><a name="examples" id= - "examples"></a>Appendix A. A simple example + "examples"></a>Appendix 1. A simple example package: bison</h2> </div> </div> @@ -12715,28 +13699,28 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#example-files">A.1. + <dt><span class="sect1"><a href="#example-files">1.1. files</a></span></dt> <dd> <dl> <dt><span class="sect2"><a href= - "#example-Makefile">A.1.1. Makefile</a></span></dt> + "#example-Makefile">1.1.1. Makefile</a></span></dt> <dt><span class="sect2"><a href= - "#example-descr">A.1.2. DESCR</a></span></dt> + "#example-descr">1.1.2. DESCR</a></span></dt> <dt><span class="sect2"><a href= - "#example-plist">A.1.3. PLIST</a></span></dt> + "#example-plist">1.1.3. PLIST</a></span></dt> <dt><span class="sect2"><a href= - "#checking-package-with-pkglint">A.1.4. Checking a + "#checking-package-with-pkglint">1.1.4. Checking a package with <span><strong class= "command">pkglint</strong></span></a></span></dt> </dl> </dd> - <dt><span class="sect1"><a href="#steps-for-b-i-p">A.2. + <dt><span class="sect1"><a href="#steps-for-b-i-p">1.2. Steps for building, installing, packaging</a></span></dt> </dl> </div> @@ -12755,7 +13739,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <h2 class="title" style="clear: both"><a name= "example-files" id= - "example-files"></a>A.1. files</h2> + "example-files"></a>1.1. files</h2> </div> </div> </div> @@ -12765,7 +13749,7 @@ PERL5_PACKLIST= ${PERL5_SITEARCH}/auto/Pg/.packlist <div> <div> <h3 class="title"><a name="example-Makefile" id= - "example-Makefile"></a>A.1.1. Makefile</h3> + "example-Makefile"></a>1.1.1. Makefile</h3> </div> </div> </div> @@ -12793,7 +13777,7 @@ INFO_FILES= bison.info <div> <div> <h3 class="title"><a name="example-descr" id= - "example-descr"></a>A.1.2. DESCR</h3> + "example-descr"></a>1.1.2. DESCR</h3> </div> </div> </div> @@ -12810,7 +13794,7 @@ of the NetBSD source tree is beyond me. <div> <div> <h3 class="title"><a name="example-plist" id= - "example-plist"></a>A.1.3. PLIST</h3> + "example-plist"></a>1.1.3. PLIST</h3> </div> </div> </div> @@ -12829,7 +13813,7 @@ share/bison.hairy <div> <h3 class="title"><a name= "checking-package-with-pkglint" id= - "checking-package-with-pkglint"></a>A.1.4. Checking + "checking-package-with-pkglint"></a>1.1.4. Checking a package with <span><strong class= "command">pkglint</strong></span></h3> </div> @@ -12839,9 +13823,10 @@ share/bison.hairy <p>The NetBSD package system comes with <a xmlns= "http://www.w3.org/TR/xhtml1/transitional" href= "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/pkgtools/pkglint/README.html" - class="pkgname">pkgtools/pkglint</a> which helps to check - the contents of these files. After installation it is - quite easy to use, just change to the directory of the + target="_top"><code xmlns="" class= + "filename">pkgtools/pkglint</code></a> which helps to + check the contents of these files. After installation it + is quite easy to use, just change to the directory of the package you wish to examine and execute <span><strong class= "command">pkglint</strong></span>:</p> @@ -12864,7 +13849,7 @@ looks fine. <div> <h2 class="title" style="clear: both"><a name= "steps-for-b-i-p" id= - "steps-for-b-i-p"></a>A.2. Steps for building, + "steps-for-b-i-p"></a>1.2. Steps for building, installing, packaging</h2> </div> </div> @@ -12883,8 +13868,12 @@ looks fine. "userinput"><code>mkdir patches</code></strong> </pre> - <p>Create <code class="filename">Makefile</code>, - <code class="filename">DESCR</code> and <code class= + <p>Create <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">Makefile</code>, <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">DESCR</code> and <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">PLIST</code> (see <a href="#components" title= "Chapter 8. Package components - files, directories and contents"> Chapter 8, <i>Package components - files, directories and @@ -12907,7 +13896,8 @@ Requesting ftp://ftp.freebsd.org/pub/FreeBSD/distfiles//bison-1.25.tar.gz (via f Successfully retrieved file. </pre> - <p>Generate the checksum of the distfile into <code class= + <p>Generate the checksum of the distfile into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">distinfo</code>:</p> <pre class="screen"> <code class="prompt">#</code> <strong class= @@ -13017,7 +14007,7 @@ Creating gzip'd tar ball in '/u/pkgsrc/lang/bison/bison-1.25.tgz' <div> <div> <h2 class="title"><a name="logs" id= - "logs"></a>Appendix B. Build logs</h2> + "logs"></a>Appendix 2. Build logs</h2> </div> </div> </div> @@ -13026,10 +14016,10 @@ Creating gzip'd tar ball in '/u/pkgsrc/lang/bison/bison-1.25.tgz' <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#logs.building">B.1. + <dt><span class="sect1"><a href="#logs.building">2.1. Building figlet</a></span></dt> - <dt><span class="sect1"><a href="#logs.package">B.2. + <dt><span class="sect1"><a href="#logs.package">2.2. Packaging figlet</a></span></dt> </dl> </div> @@ -13040,7 +14030,7 @@ Creating gzip'd tar ball in '/u/pkgsrc/lang/bison/bison-1.25.tgz' <div> <h2 class="title" style="clear: both"><a name= "logs.building" id= - "logs.building"></a>B.1. Building figlet</h2> + "logs.building"></a>2.1. Building figlet</h2> </div> </div> </div> @@ -13144,7 +14134,7 @@ cp figlet.6 /usr/pkg/man/man6 <div> <h2 class="title" style="clear: both"><a name= "logs.package" id= - "logs.package"></a>B.2. Packaging figlet</h2> + "logs.package"></a>2.2. Packaging figlet</h2> </div> </div> </div> @@ -13167,7 +14157,7 @@ Registering depends:. <div> <div> <h2 class="title"><a name="ftp-layout" id= - "ftp-layout"></a>Appendix C. Layout of the + "ftp-layout"></a>Appendix 3. Layout of the FTP server's package archive</h2> </div> </div> @@ -13272,7 +14262,7 @@ Registering depends:. <div> <div> <h2 class="title"><a name="editing" id= - "editing"></a>Appendix D. Editing guidelines + "editing"></a>Appendix 4. Editing guidelines for the pkgsrc guide</h2> </div> </div> @@ -13282,10 +14272,10 @@ Registering depends:. <p><b>Table of Contents</b></p> <dl> - <dt><span class="sect1"><a href="#targets">D.1. + <dt><span class="sect1"><a href="#targets">4.1. Targets</a></span></dt> - <dt><span class="sect1"><a href="#procedure">D.2. + <dt><span class="sect1"><a href="#procedure">4.2. Procedure</a></span></dt> </dl> </div> @@ -13298,29 +14288,33 @@ Registering depends:. <div> <div> <h2 class="title" style="clear: both"><a name= - "targets" id="targets"></a>D.1. Targets</h2> + "targets" id="targets"></a>4.1. Targets</h2> </div> </div> </div> - <p>The pkgsrc guide's source code is stored in <code class= + <p>The pkgsrc guide's source code is stored in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/doc/guide/files</code>, and several files are created from it:</p> <div class="itemizedlist"> <ul type="disc"> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/doc/pkgsrc.txt</code></p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/doc/pkgsrc.html</code></p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">http://www.NetBSD.org/Documentation/pkgsrc/</code>: the documentation on the NetBSD website will be built from pkgsrc and kept up to date on the web server @@ -13330,13 +14324,15 @@ Registering depends:. </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.pdf</code>: PDF version of the pkgsrc guide.</p> </li> <li> - <p><code class= + <p><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">http://www.NetBSD.org/Documentation/pkgsrc/pkgsrc.ps</code>: PostScript version of the pkgsrc guide.</p> </li> @@ -13350,7 +14346,7 @@ Registering depends:. <div> <h2 class="title" style="clear: both"><a name= "procedure" id= - "procedure"></a>D.2. Procedure</h2> + "procedure"></a>4.2. Procedure</h2> </div> </div> </div> @@ -13370,27 +14366,33 @@ Registering depends:. PostScript- and PDF version. You will need both packages installed, to make sure documentation is consistent across all formats. The packages can be - found in <code class= + found in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/meta-pkgs/netbsd-doc</code> and - <code class= + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/meta-pkgs/netbsd-doc-print</code>.</p> </li> <li> - <p>Edit the XML file(s) in <code class= + <p>Edit the XML file(s) in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/doc/guide/files</code>.</p> </li> <li> <p>Run <span><strong class="command">make extract && make do-lint</strong></span> in - <code class="filename">pkgsrc/doc/guide</code> to - check the XML syntax, and fix it if needed.</p> + <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">pkgsrc/doc/guide</code> to check the XML + syntax, and fix it if needed.</p> </li> <li> <p>Run <span><strong class= - "command">make</strong></span> in <code class= + "command">make</strong></span> in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/doc/guide</code> to build the HTML and ASCII version.</p> </li> @@ -13398,7 +14400,8 @@ Registering depends:. <li> <p>If all is well, run <span><strong class= "command">make install-doc</strong></span> to put the - generated files into <code class= + generated files into <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= "filename">pkgsrc/doc</code>.</p> </li> |