diff options
author | rillig <rillig@pkgsrc.org> | 2006-02-18 17:18:14 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-02-18 17:18:14 +0000 |
commit | 86a6e577abfdfbbd13745fa92ab29b70cbe6533b (patch) | |
tree | f59dc59421ab0b6bb66150abca2b3db43a44824c /doc | |
parent | ff01a31de9450414d2b999faa1417f702a10c03c (diff) | |
download | pkgsrc-86a6e577abfdfbbd13745fa92ab29b70cbe6533b.tar.gz |
regen.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/pkgsrc.html | 335 | ||||
-rw-r--r-- | doc/pkgsrc.txt | 141 |
2 files changed, 391 insertions, 85 deletions
diff --git a/doc/pkgsrc.html b/doc/pkgsrc.html index 461a4b42810..b47e3a4de1e 100644 --- a/doc/pkgsrc.html +++ b/doc/pkgsrc.html @@ -66,8 +66,8 @@ alink="#0000FF"> </div> <div xmlns="http://www.w3.org/TR/xhtml1/transitional"> - <p xmlns="" class="pubdate">$NetBSD: pkgsrc.xml,v 1.11 - 2006/01/13 17:42:33 reed Exp $</p> + <p xmlns="" class="pubdate">$NetBSD: pkgsrc.xml,v 1.12 + 2006/02/18 01:46:43 rillig Exp $</p> </div> <div> @@ -1023,6 +1023,21 @@ alink="#0000FF"> pkgsrc</a></span></dt> </dl> </dd> + + <dt><span class="chapter"><a href="#porting">19. + Porting pkgsrc</a></span></dt> + + <dd> + <dl> + <dt><span class="sect1"><a href= + "#porting.opsys">19.1. Porting pkgsrc to a new + operating system</a></span></dt> + + <dt><span class="sect1"><a href= + "#porting.compiler">19.2. Adding support for a new + compiler</a></span></dt> + </dl> + </dd> </dl> </dd> @@ -2985,11 +3000,12 @@ alink="#0000FF"> "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/shells/bash/README.html" target="_top"><code xmlns="" class= "filename">shells/bash</code></a> and adding the - following line to your <code xmlns= + following lines to your <code xmlns= "http://www.w3.org/TR/xhtml1/transitional" class= "filename">mk.conf</code>:</p> <pre class="programlisting"> CONFIG_SHELL= ${LOCALBASE}/bin/bash + WRAPPER_SHELL= ${LOCALBASE}/bin/bash </pre> </div> </div> @@ -4252,6 +4268,21 @@ PKG_OPTIONS.apache= suexec <div class="itemizedlist"> <ul type="disc"> <li> + <p><code class= + "varname">ALLOW_VULNERABLE_PACKAGES</code> + should be set to <code class= + "literal">yes</code>. The purpose of the bulk + builds is creating binary packages, no matter + if they are vulnerable or not. When uploading + the packages to a public server, the vulnerable + packages will be put into a directory of their + own. Leaving this variable unset would prevent + the bulk build system from even trying to build + them, so possible building errors would not + show up.</p> + </li> + + <li> <p><code class="varname">CHECK_FILES</code> (<code xmlns= "http://www.w3.org/TR/xhtml1/transitional" @@ -6585,6 +6616,21 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> pkgsrc</a></span></dt> </dl> </dd> + + <dt><span class="chapter"><a href="#porting">19. Porting + pkgsrc</a></span></dt> + + <dd> + <dl> + <dt><span class="sect1"><a href= + "#porting.opsys">19.1. Porting pkgsrc to a new + operating system</a></span></dt> + + <dt><span class="sect1"><a href= + "#porting.compiler">19.2. Adding support for a new + compiler</a></span></dt> + </dl> + </dd> </dl> </div> @@ -6766,7 +6812,8 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> <pre class="programlisting"> DISTFILES= ${DISTNAME}${EXTRACT_SUFX} DISTFILES+= foo-file.tar.gz - SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ + SITES_foo-file.tar.gz= \ + http://www.somewhere.com/somehow/ \ http://www.somewhereelse.com/mirror/somehow/ </pre> </li> @@ -10625,9 +10672,9 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> "filename">pkgsrc/wm/scwm/Makefile</code>:</p> <pre class="programlisting"> EVAL_PREFIX+= GTKDIR=gtk+ - CONFIGURE_ARGS+= --with-guile-prefix=${LOCALBASE} \ - --with-gtk-prefix="${GTKDIR}" \ - --enable-multibyte + CONFIGURE_ARGS+= --with-guile-prefix=${LOCALBASE:Q} + CONFIGURE_ARGS+= --with-gtk-prefix=${GTKDIR:Q} + CONFIGURE_ARGS+= --enable-multibyte </pre> <p>Specific defaults can be defined for the @@ -10827,64 +10874,64 @@ nbftp% <strong class="userinput"><code>chmod 755 .</code></strong> </div> <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 xmlns="http://www.w3.org/TR/xhtml1/transitional" - class="filename">.tar.gz</code>.</p> + they need to be extracted, as they usually come in the + form of some compressed archive format.</p> - <p>If only some of the distfiles need to be uncompressed, - the files to be uncompressed should be put into - <code class="varname">EXTRACT_ONLY</code>.</p> + <p>By default, all <code class="varname">DISTFILES</code> + are extracted. If you only need some of them, you can set + the <code class="varname">EXTRACT_ONLY</code> variable to + the list of those files.</p> - <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= - "varname">EXTRACT_CMD</code>, <code class= - "varname">EXTRACT_BEFORE_ARGS</code> and <code class= - "varname">EXTRACT_AFTER_ARGS</code>. In the former case, - pkgsrc knows how to extract a number of suffixes - (<code 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= + <p>Extracting the files is usually done by a little + program, <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= + "filename">mk/scripts/extract</code>, which already knows + how to extract various archive formats, so most likely + you will not need to change anything here. But if you + need, the following variables may help you:</p> + + <div class="variablelist"> + <dl> + <dt><span class="term"><code class= + "varname">EXTRACT_OPTS_{BIN,LHA,PAX,RAR,TAR,ZIP,ZOO}</code></span></dt> + + <dd> + <p>Use these variables to override the default + options for an extract command, which are defined + in <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">mk/scripts/extract</code>.</p> + </dd> + + <dt><span class="term"><code class= + "varname">EXTRACT_USING</code></span></dt> + + <dd> + <p>This variable can be set to <code class= + "literal">pax</code>, <code class= + "literal">tar</code> or an absolute pathname + pointing to the command with which tar archives + should be extracted.</p> + </dd> + </dl> + </div> + + <p>If the <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 in - <code xmlns="http://www.w3.org/TR/xhtml1/transitional" - class="filename">bsd.pkg.extract.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= + "filename">extract</code> program doesn't serve your + needs, you can also override the <code class= + "varname">EXTRACT_CMD</code> variable, which holds the + command used for extracting the files. This command is + executed in the <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 - EXTRACT_BEFORE_ARGS= - EXTRACT_AFTER_ARGS= |sh -</pre> + "filename">${WRKSRC}</code> directory. During execution + of this command, the shell variable <code class= + "varname">extract_file</code> holds the absolute pathname + of the file that is going to be extracted.</p> + + <p>And if that still does not suffice, you can override + the <code class="varname">do-extract</code> target in the + package Makefile.</p> </div> <div class="sect1" lang="en"> @@ -15127,6 +15174,174 @@ TOOLS_PLATFORM.true?= true # shell builtin </div> </div> </div> + + <div class="chapter" lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title"><a name= + "porting"></a>Chapter 19. Porting + pkgsrc</h2> + </div> + </div> + </div> + + <div class="toc"> + <p><b>Table of Contents</b></p> + + <dl> + <dt><span class="sect1"><a href="#porting.opsys">19.1. + Porting pkgsrc to a new operating + system</a></span></dt> + + <dt><span class="sect1"><a href= + "#porting.compiler">19.2. Adding support for a new + compiler</a></span></dt> + </dl> + </div> + + <p>The pkgsrc system has already been ported to many + operating systems, hardware architectures and compilers. + This chapter explains the necessary steps to make pkgsrc + even more portable.</p> + + <div class="sect1" lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a name= + "porting.opsys"></a>19.1. Porting pkgsrc to a + new operating system</h2> + </div> + </div> + </div> + + <p>To port pkgsrc to a new operating system (called + <code class="literal">MyOS</code> in this example), you + need to touch the following files:</p> + + <div class="variablelist"> + <dl> + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">bootstrap/mods/mk/<em class= + "replaceable"><code>MyOS</code></em>.sys.mk</code></span></dt> + + <dd> + <p>This file contains some basic definitions, for + example the name of the C compiler.</p> + </dd> + + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">mk/bsd.prefs.mk</code></span></dt> + + <dd> + <p>Insert code that defines the variables + <code class="varname">OPSYS</code>, <code class= + "varname">OS_VERSION</code>, <code class= + "varname">LOWER_OS_VERSION</code>, <code class= + "varname">LOWER_VENDOR</code>, <code class= + "varname">MACHINE_ARCH</code>, <code class= + "varname">OBJECT_FMT</code>, <code class= + "varname">APPEND_ELF</code>, and the other + variables that appear in this file.</p> + </dd> + + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">mk/platform/MyOS.mk</code></span></dt> + + <dd> + <p>This file contains the platform-specific + definitions that are used by pkgsrc. Start by + copying one of the other files and edit it to your + needs.</p> + </dd> + + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">mk/platform/MyOS.pkg.dist</code></span></dt> + + <dd> + <p>This file contains a list of directories, + together with their permission bits and ownership. + These directories will be created automatically + with every package that does not explicitly set + <code class="varname">NO_MTREE</code>. There have + been some discussions about whether this file is + needed at all, but with no result.</p> + </dd> + + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">mk/platform/MyOS.x11.dist</code></span></dt> + + <dd> + <p>Just copy one of the pre-existing x11.dist files + to your <code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename"><em class= + "replaceable"><code>MyOS</code></em>.x11.dist</code>.</p> + </dd> + + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">mk/tools/bootstrap.mk</code></span></dt> + + <dd> + <p>On some operating systems, the tools that are + provided with the base system are not good enough + for pkgsrc. For example, there are many versions of + <a href= + "http://netbsd.gw.com/cgi-bin/man-cgi?sed+1+NetBSD-current"> + <span class="citerefentry"><span class= + "refentrytitle">sed</span>(1)</span></a> that have + a narrow limit on the line length they can process. + Therefore pkgsrc brings its own tools, which can be + enabled here.</p> + </dd> + + <dt><span class="term"><code xmlns= + "http://www.w3.org/TR/xhtml1/transitional" class= + "filename">mk/tools/<em class= + "replaceable"><code>MyOS</code></em>.mk</code></span></dt> + + <dd> + <p>This file defines the paths to all the tools + that are needed by one or the other package in + pkgsrc, as well as by pkgsrc itself. Find out where + these tools are on your platform and add them.</p> + </dd> + </dl> + </div> + + <p>Now, you should be able to build some basic packages, + like <a xmlns="http://www.w3.org/TR/xhtml1/transitional" + href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/lang/perl5/README.html" + target="_top"><code xmlns="" class= + "filename">lang/perl5</code></a>, <a xmlns= + "http://www.w3.org/TR/xhtml1/transitional" href= + "ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/shells/bash/README.html" + target="_top"><code xmlns="" class= + "filename">shells/bash</code></a>.</p> + </div> + + <div class="sect1" lang="en"> + <div class="titlepage"> + <div> + <div> + <h2 class="title" style="clear: both"><a name= + "porting.compiler"></a>19.2. Adding support + for a new compiler</h2> + </div> + </div> + </div> + + <p>TODO</p> + </div> + </div> </div> <div class="appendix" lang="en"> diff --git a/doc/pkgsrc.txt b/doc/pkgsrc.txt index f8af187b0f2..a6b135f1d63 100644 --- a/doc/pkgsrc.txt +++ b/doc/pkgsrc.txt @@ -14,7 +14,7 @@ The pkgsrc Developers Copyright (C) 1994-2005 The NetBSD Foundation, Inc -$NetBSD: pkgsrc.xml,v 1.11 2006/01/13 17:42:33 reed Exp $ +$NetBSD: pkgsrc.xml,v 1.12 2006/02/18 01:46:43 rillig Exp $ Abstract @@ -289,6 +289,11 @@ II. The pkgsrc developer's guide 18.4. Updating a package to a newer version 18.5. Moving a package in pkgsrc + 19. Porting pkgsrc + + 19.1. Porting pkgsrc to a new operating system + 19.2. Adding support for a new compiler + A. A simple example package: bison A.1. files @@ -1083,9 +1088,10 @@ are in your PATH. This includes /usr/ccs/{bin,lib} and e.g. /usr/pkg/ Sometimes, when using libtool, /bin/ksh crashes with a segmentation fault. The workaround is to use another shell for the configure scripts, for example by -installing shells/bash and adding the following line to your mk.conf: +installing shells/bash and adding the following lines to your mk.conf: CONFIG_SHELL= ${LOCALBASE}/bin/bash + WRAPPER_SHELL= ${LOCALBASE}/bin/bash Chapter 4. Using pkgsrc @@ -1565,6 +1571,13 @@ briefly described here. Some other options are scattered in the pkgsrc infrastructure: + * ALLOW_VULNERABLE_PACKAGES should be set to yes. The purpose of the bulk + builds is creating binary packages, no matter if they are vulnerable or + not. When uploading the packages to a public server, the vulnerable + packages will be put into a directory of their own. Leaving this variable + unset would prevent the bulk build system from even trying to build them, + so possible building errors would not show up. + * CHECK_FILES (pkgsrc/mk/bsd.pkg.check.mk) can be set to "yes" to check that the installed set of files matches the PLIST. @@ -2377,6 +2390,11 @@ Table of Contents 18.4. Updating a package to a newer version 18.5. Moving a package in pkgsrc +19. Porting pkgsrc + + 19.1. Porting pkgsrc to a new operating system + 19.2. Adding support for a new compiler + Chapter 8. Package components - files, directories and contents Table of Contents @@ -2470,7 +2488,8 @@ exactly in the order given here. DISTFILES= ${DISTNAME}${EXTRACT_SUFX} DISTFILES+= foo-file.tar.gz - SITES_foo-file.tar.gz=http://www.somewhere.com/somehow/ \ + SITES_foo-file.tar.gz= \ + http://www.somewhere.com/somehow/ \ http://www.somewhereelse.com/mirror/somehow/ * DISTFILES: Name(s) of archive file(s) containing distribution. The default @@ -4015,9 +4034,9 @@ When choosing which of these variables to use, follow the following rules: The following lines are taken from pkgsrc/wm/scwm/Makefile: EVAL_PREFIX+= GTKDIR=gtk+ - CONFIGURE_ARGS+= --with-guile-prefix=${LOCALBASE} \ - --with-gtk-prefix="${GTKDIR}" \ - --enable-multibyte + CONFIGURE_ARGS+= --with-guile-prefix=${LOCALBASE:Q} + CONFIGURE_ARGS+= --with-gtk-prefix=${GTKDIR:Q} + CONFIGURE_ARGS+= --enable-multibyte Specific defaults can be defined for the packages evaluated using EVAL_PREFIX, by using a definition of the form: @@ -4099,25 +4118,34 @@ changed distfiles on the master distribution site or network lossage. 14.7. The extract phase When the distfiles are present on the local system, they need to be extracted, -as they are usually in the form of some compressed archive format, most -commonly .tar.gz. - -If only some of the distfiles need to be uncompressed, the files to be -uncompressed should be put into EXTRACT_ONLY. - -If the distfiles are not in .tar.gz format, they can be extracted by setting -either EXTRACT_SUFX, or EXTRACT_CMD, EXTRACT_BEFORE_ARGS and -EXTRACT_AFTER_ARGS. In the former case, pkgsrc knows how to extract a number of -suffixes (.tar.gz, .tgz, .tar.gz2, .tbz, .tar.Z, .tar, .shar.gz, .shar.bz2, -.shar.Z, .shar, .Z, .bz2 and .gz; see the definition of the various -DECOMPRESS_CMD variables in bsd.pkg.extract.mk for a complete list). Here's an -example on how to use the other variables for a program that comes with a -compressed shell archive whose name ends in .msg.gz: - - EXTRACT_SUFX= .msg.gz - EXTRACT_CMD= zcat - EXTRACT_BEFORE_ARGS= - EXTRACT_AFTER_ARGS= |sh +as they usually come in the form of some compressed archive format. + +By default, all DISTFILES are extracted. If you only need some of them, you can +set the EXTRACT_ONLY variable to the list of those files. + +Extracting the files is usually done by a little program, mk/scripts/extract, +which already knows how to extract various archive formats, so most likely you +will not need to change anything here. But if you need, the following variables +may help you: + +EXTRACT_OPTS_{BIN,LHA,PAX,RAR,TAR,ZIP,ZOO} + + Use these variables to override the default options for an extract command, + which are defined in mk/scripts/extract. + +EXTRACT_USING + + This variable can be set to pax, tar or an absolute pathname pointing to + the command with which tar archives should be extracted. + +If the extract program doesn't serve your needs, you can also override the +EXTRACT_CMD variable, which holds the command used for extracting the files. +This command is executed in the ${WRKSRC} directory. During execution of this +command, the shell variable extract_file holds the absolute pathname of the +file that is going to be extracted. + +And if that still does not suffice, you can override the do-extract target in +the package Makefile. 14.8. The patch phase @@ -5849,6 +5877,69 @@ possibly untested features. (and any packages from step 5, of course). +Chapter 19. Porting pkgsrc + +Table of Contents + +19.1. Porting pkgsrc to a new operating system +19.2. Adding support for a new compiler + +The pkgsrc system has already been ported to many operating systems, hardware +architectures and compilers. This chapter explains the necessary steps to make +pkgsrc even more portable. + +19.1. Porting pkgsrc to a new operating system + +To port pkgsrc to a new operating system (called MyOS in this example), you +need to touch the following files: + +bootstrap/mods/mk/MyOS.sys.mk + + This file contains some basic definitions, for example the name of the C + compiler. + +mk/bsd.prefs.mk + + Insert code that defines the variables OPSYS, OS_VERSION, LOWER_OS_VERSION, + LOWER_VENDOR, MACHINE_ARCH, OBJECT_FMT, APPEND_ELF, and the other variables + that appear in this file. + +mk/platform/MyOS.mk + + This file contains the platform-specific definitions that are used by + pkgsrc. Start by copying one of the other files and edit it to your needs. + +mk/platform/MyOS.pkg.dist + + This file contains a list of directories, together with their permission + bits and ownership. These directories will be created automatically with + every package that does not explicitly set NO_MTREE. There have been some + discussions about whether this file is needed at all, but with no result. + +mk/platform/MyOS.x11.dist + + Just copy one of the pre-existing x11.dist files to your MyOS.x11.dist. + +mk/tools/bootstrap.mk + + On some operating systems, the tools that are provided with the base system + are not good enough for pkgsrc. For example, there are many versions of sed + (1) that have a narrow limit on the line length they can process. Therefore + pkgsrc brings its own tools, which can be enabled here. + +mk/tools/MyOS.mk + + This file defines the paths to all the tools that are needed by one or the + other package in pkgsrc, as well as by pkgsrc itself. Find out where these + tools are on your platform and add them. + +Now, you should be able to build some basic packages, like lang/perl5, shells/ +bash. + +19.2. Adding support for a new compiler + +TODO + Appendix A. A simple example package: bison Table of Contents |