[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pkgsrc/doc/guide/files/pkginstall.xml 1.3



以下のページの翻訳をしました。ツッコミをお願いします。

pkgsrc/doc/guide/files/pkginstall.xml 1.3

月曜日までに異議がなければ、 commit します。

以下は原文との差分です。

--- pkginstall.xml.orig	2006-09-23 23:47:49.000000000 +0900
+++ pkginstall.xml	2006-09-28 21:41:08.000000000 +0900
@@ -1,106 +1,108 @@
 <!-- $NetBSD: pkginstall.xml,v 1.3 2005/06/03 13:05:20 jmmv Exp $ -->
+<!-- Based on english version: -->
+<!-- NetBSD: pkginstall.xml,v 1.3 2005/06/03 13:05:20 jmmv Exp   -->
 
 <chapter id="pkginstall"> <?dbhtml filename="pkginstall.html"?>
-<title>The pkginstall framework</title>
+<title>pkginstall の枠組</title>
 
-<para>This chapter describes the framework known as
-<literal>pkginstall</literal>, whose key features are:</para>
+<para>本章では、<literal>pkginstall</literal> の枠組について説明します。
+主な機能は以下のとおりです。</para>
 
 <itemizedlist>
 
   <listitem>
-    <para>Generic installation and manipulation of directories and files
-    outside the pkgsrc-handled tree, <varname>LOCALBASE</varname>.</para>
+    <para>pkgsrc が扱うツリー (<varname>LOCALBASE</varname>)
+    以外の場所のディレクトリーやファイルの、汎用的なインストールおよび操作。</para>
   </listitem>
 
   <listitem>
-    <para>Automatic handling of configuration files during installation,
-    provided that packages are correctly designed.</para>
+    <para>インストール時における、設定ファイルの自動処理
+    (パッケージが正しく設計されていればですが)。</para>
   </listitem>
 
   <listitem>
-    <para>Generation and installation of system startup scripts.</para>
+    <para>システム起動スクリプトの作成およびインストール。</para>
   </listitem>
 
   <listitem>
-    <para>Registration of system users and groups.</para>
+    <para>システムユーザーおよびグループの登録。</para>
   </listitem>
 
   <listitem>
-    <para>Registration of system shells.</para>
+    <para>システムシェルの登録。</para>
   </listitem>
 
 </itemizedlist>
 
-<para>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 <filename>Makefile</filename>:</para>
+<para>以下の各節では、上述の各機能について詳しく見てゆきます。
+なお、ここで説明する各機能を使うためには、パッケージの
+<filename>Makefile</filename> に以下の内容を書く必要があります。</para>
 
 <programlisting>USE_PKGINSTALL=YES</programlisting>
 
-<para>You may be thinking that many of the things described here could be
-easily done with simple code in the package's post-installation target
-(<literal>post-install</literal>).  <emphasis>This is incorrect</emphasis>,
-as the code in them is only executed when building from source.  Machines
-using binary packages could not benefit from it at all (as the code itself
-could be unavailable).  Therefore, the only way to achieve any of the items
-described above is by means of the installation scripts, which are
-automatically generated by pkginstall.</para>
+<para>本章で説明する機能の多くは、パッケージのインストール後のターゲット
+(<literal>post-install</literal>) を使うだけで簡単に実現できるのではないか、
+とお思いになるかもしれませんが、<emphasis>それは正しくありません</emphasis>。
+このターゲットのコードは、パッケージをソースから構築した場合しか実行されないからです。
+バイナリーパッケージを使う場合は、(コード自体が利用できないので)
+このターゲットのコードでは何もできません。したがって、上述の各機能は、
+pkginstall が自動生成するインストール用スクリプトでしか実現できないのです。</para>
 
 <!-- ================================================================== -->
 
 <sect1 id="files-and-dirs-outside-prefix">
-<title>Files and directories outside the installation prefix</title>
+<title>インストール用のプレフィックス以外の場所にあるファイルとディレクトリー</title>
 
-<para>As you already know, the <filename>PLIST</filename> file holds a list
-of files and directories that belong to a package.  The names used in it
-are relative to the installation prefix (<filename>${PREFIX}</filename>),
-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
-<filename>${VARBASE}</filename> or
-<filename>${PKG_SYSCONFDIR}</filename>.</para>
+<para>すでにご存知のとおり、<filename>PLIST</filename> ファイルには、
+パッケージに属するファイルとディレクトリーの一覧が書かれています。
+この一覧では、インストール用のプレフィックス
+(<filename>${PREFIX}</filename>) からの相対位置を使うため、
+このディレクトリー以外の場所にあるファイルを書くことはできません
+(絶対パス名は使えません)。この制約がある一方で、
+パッケージによってはそのような場所、たとえば
+<filename>${VARBASE}</filename> や
+<filename>${PKG_SYSCONFDIR}</filename>
+以下にファイルをインストールする必要があります。</para>
 
-<para>The only way to achieve this is to create such files during
-installation time by using the installation scripts.  These scripts can run
-arbitrary commands, so they have the potential to create and manage files
-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
-<filename>Makefile</filename>.  The rest of this section describes which
-these variables are.</para>
+<para>これをおこなう唯一の方法は、インストール時にインストール用のスクリプトを使って
+インストール対象のファイルを作成することです。このスクリプトでは任意のコマンドを実行できるので、
+ファイルシステム中のどこであってもファイルの作成や管理をすることができます。
+ここで pkginstall の出番となります。pkginstall は、
+パッケージの <filename>Makefile</filename> で設定された変数にもとづき、
+インストール対象のファイルやディレクトリーを操作するための汎用のスクリプトを提供します。
+以下、本節では、この用途で使う変数を説明します。</para>
 
 <!-- ================================================================== -->
 
 <sect2 id="dirs-outside-prefix">
-<title>Directory manipulation</title>
+<title>ディレクトリーの操作</title>
 
-<para>The following variables can be set to request the creation of
-directories anywhere in the filesystem:</para>
+<para>以下の変数は、ファイルシステムの任意の場所へディレクトリーを作成するために、
+設定することができます。</para>
 
 <itemizedlist>
 
   <listitem>
-    <para><varname>MAKE_DIRS</varname> and <varname>OWN_DIRS</varname>
-    contain a list of directories that should be created and should attempt
-    to be destroyed by the installation scripts.  The difference between
-    the two is that the latter prompts the administrator to remove any
-    directories that may be left after deinstallation (because they were
-    not empty), while the former does not.</para>
+    <para><varname>MAKE_DIRS</varname> と <varname>OWN_DIRS</varname> は、
+    インストール用スクリプトが作成したり、
+    削除を試みたりする対象のディレクトリーのリストを値として持ちます。
+    両変数の違いは、後者はアンインストール時に (空でなかったために)
+    削除できなかった各ディレクトリーを削除するよう管理者に対してうながしますが、
+    前者はそうしないことです。</para>
   </listitem>
 
   <listitem>
-    <para><varname>MAKE_DIRS_PERMS</varname> and
-    <varname>OWN_DIRS_PERMS</varname> contain a list of tuples describing
-    which directories should be created and should attempt to be destroyed
-    by the installation scripts.  Each tuple holds the following values,
-    separated by spaces: the directory name, its owner, its group and its
-    numerical mode.  For example:</para>
+    <para><varname>MAKE_DIRS_PERMS</varname> と
+    <varname>OWN_DIRS_PERMS</varname> は、インストール用スクリプトが作成したり、
+    削除しようとしたりする対象のディレクトリーについて記述したタプルのリストを値として持ちます。
+    各タプルは、ディレクトリー名、所有者、所有グループと、
+    数字で表したモードの値をスペースで区切ったものからなります。
+    たとえば以下のようになります。</para>
 
     <programlisting>MAKE_DIRS_PERMS+= ${VARBASE}/foo/private ${ROOT_USER} ${ROOT_GROUP} 0700</programlisting>
 
-    <para>The difference between the two is exactly the same as their
-    non-<varname>PERMS</varname> counterparts.</para>
+    <para>両変数の違いは、<varname>PERMS</varname>
+    のつかない変数の違いとまったく同じです。</para>
   </listitem>
 
 </itemizedlist>
@@ -110,45 +112,46 @@
 <!-- ================================================================== -->
 
 <sect2 id="files-outside-prefix">
-<title>File manipulation</title>
+<title>ファイルの操作</title>
 
-<para>Creating non-empty files outside the installation prefix is tricky
-because the <filename>PLIST</filename> 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 installation prefix) and copy it to the
-appropriate location during installation (done by the installation scripts
-generated by pkginstall).  We will call the former the <emphasis>master
-file</emphasis> in the following paragraphs, which describe the variables
-that can be used to automatically and consistently handle files outside the
-installation prefix:</para>
+<para>インストール用プレフィックス以外の場所に空でないファイルを作ることは、やりにくいことです。
+なぜなら <filename>PLIST</filename> は全ファイルをインストール用プレフィックス内にあるものとして扱うからです。
+この問題に対する唯一の解決策は、インストールの際に、
+ファイルをいったん既知の場所 (つまり、インストール用プレフィックス内)
+に展開し、それを本来の場所にコピーすることです
+(pkginstall が生成するインストール用スクリプトがおこないます)。
+以下、インストール用プレフィックス以外の場所のファイルを自動的かつ首尾一貫して扱うために使える変数について説明しますが、
+ここではプレフィックス内にいったん展開したファイルのことを原本ファイル (<emphasis>master
+file</emphasis>) ということにします。</para>
 
 <itemizedlist>
 
   <listitem>
-    <para><varname>CONF_FILES</varname> and
-    <varname>SUPPORT_FILES</varname> are pairs of master and target files.
-    During installation time, the master file is copied to the target one
-    if and only if the latter does not exist.  Upon deinstallation, the
-    target file is removed provided that it was not modified by the
-    installation.</para>
+    <para><varname>CONF_FILES</varname> と
+    <varname>SUPPORT_FILES</varname> は、
+    原本ファイルとコピー先ファイルの組のリストを値として持ちます。
+    インストール時に、コピー先ファイルが存在しなかった場合に限って、
+    原本ファイルがコピー先ファイルにコピーされます。アンインストール時は、
+    コピー先ファイルがインストールにおいて変更されていなければ、
+    コピー先ファイルが削除されます。</para>
 
-    <para>The difference between the two is that the latter prompts the
-    administrator to remove any files that may be left after
-    deinstallation (because they were not empty), while the former does
-    not.</para>
+    <para>両変数の違いは、後者はアンインストール時に (空でなかったために)
+    削除できなかった各ファイルを削除するよう管理者に対してうながしますが、
+    前者はそうしないことです。</para>
   </listitem>
 
   <listitem>
-    <para><varname>CONF_FILES_PERMS</varname> and
-    <varname>SUPPORT_FILES_PERMS</varname> contain tuples describing master
-    files as well as their target locations.  For each of them, it also
-    specifies their owner, their group and their numeric permissions, in
-    this order.  For example:</para>
+    <para><varname>CONF_FILES_PERMS</varname> と
+    <varname>SUPPORT_FILES_PERMS</varname> は、
+    原本ファイルとコピー先ファイルについて記述したタプルのリストを値として持ちます。
+    各タプルは、ファイル名のほか、両ファイルの所有者、所有グループと、
+    数字で表したパーミッションを、この順番で指定します。
+    たとえば以下のようになります。</para>
 
     <programlisting>SUPPORT_FILES_PERMS+= ${PREFIX}/share/somefile ${VARBASE}/somefile ${ROOT_USER} ${ROOT_GROUP} 0700</programlisting>
 
-    <para>The difference between the two is exactly the same as their
-    non-<varname>PERMS</varname> counterparts.</para>
+    <para>両変数の違いは、<varname>PERMS</varname>
+    のつかない変数の違いとまったく同じです。</para>
   </listitem>
 
 </itemizedlist>
@@ -160,167 +163,169 @@
 <!-- ================================================================== -->
 
 <sect1 id="conf-files">
-<title>Configuration files</title>
+<title>設定ファイル</title>
 
-<para>Configuration files are special in the sense that they are installed
-in their own specific directory, <varname>PKG_SYSCONFDIR</varname>, and
-need special treatment during installation (most of which is automated by
-pkginstall).  The main concept you must bear in mind is that files marked
-as configuration files are automatically copied to the right place (somewhere
-inside <varname>PKG_SYSCONFDIR</varname>) during installation <emphasis>if
-and only if</emphasis> they didn't exist before.  Similarly, they will not
-be removed if they have local modifications.  This ensures that
-administrators never lose any custom changes they may have made.</para>
+<para>(個々のパッケージの) 設定ファイルは、パッケージに固有のディレクトリー
+<varname>PKG_SYSCONFDIR</varname> にインストールされ、また、
+インストール時には特別扱いが必要である (ほとんどのことは、pkginstall
+で自動化されています) という点で、特別です。主に心がける必要があることは、
+設定ファイルであるとされたファイルは、インストール時に、
+そのファイルがもともと存在しなかった場合<emphasis>に限って</emphasis>、
+正しい場所 (<varname>PKG_SYSCONFDIR</varname>
+以下のどこか) に自動的にコピーされるということです。同様にして、
+設定ファイルにローカルな変更が加わっている場合には、
+アンインストール時に削除されません。こうすることで、
+管理者が独自に変更をおこなっても、その変更が失われることがないようにしています。</para>
 
 <!-- ================================================================== -->
 
 <sect2 id="conf-files-sysconfdir">
-<title>How <varname>PKG_SYSCONFDIR</varname> is set</title>
+<title><varname>PKG_SYSCONFDIR</varname> はどのように設定されるか</title>
 
-<para>As said before, the <varname>PKG_SYSCONFDIR</varname> variable
-specifies where configuration files shall be installed.  Its contents are
-set based upon the following variables:</para>
+<para>前述のとおり、<varname>PKG_SYSCONFDIR</varname>
+変数は設定ファイルのインストール先を指定します。この変数の値は、
+以下の各変数をもとに設定されます。</para>
 
 <itemizedlist>
 
   <listitem>
-    <para><varname>PKG_SYSCONFBASE</varname>: The configuration's root
-    directory.  Defaults to <filename>${PREFIX}/etc</filename> although it may
-    be overridden by the user to point to his preferred location (e.g.,
-    <filename>/etc</filename>, <filename>/etc/pkg</filename>, etc.).
-    Packages must not use it directly.</para>
+    <para><varname>PKG_SYSCONFBASE</varname>: 設定ディレクトリーのルートです。
+    指定しなかった場合は <filename>${PREFIX}/etc</filename> となりますが、
+    利用者は好みの場所 (たとえば、
+    <filename>/etc</filename>, <filename>/etc/pkg</filename> など)
+    を指すよう上書きすることもできます。
+    パッケージがこの変数を直接使うことはできません。</para>
   </listitem>
 
   <listitem>
-    <para><varname>PKG_SYSCONFSUBDIR</varname>: A subdirectory of
-    <varname>PKG_SYSCONFBASE</varname> under which the configuration files
-    for the package being built shall be installed.  The definition of this
-    variable only makes sense in the package's
-    <filename>Makefile</filename> (i.e., it is not user
-    customizable).</para>
+    <para><varname>PKG_SYSCONFSUBDIR</varname>: <varname>PKG_SYSCONFBASE</varname>
+    のサブディレクトリーで、
+    構築されたパッケージ用の設定ファイルはこの下に置かれます。
+    この変数は、パッケージの
+    <filename>Makefile</filename> で定義された場合にのみ意味を持ちます (つまり、
+    利用者がカスタマイズすることはできません)。</para>
 
-    <para>As an example, consider the Apache package,
-    <pkg>www/apache2</pkg>, which places its configuration files under the
-    <filename>httpd/</filename> subdirectory of
-    <varname>PKG_SYSCONFBASE</varname>.  This should be set in the package
-    Makefile.</para>
+    <para>例としては、Apache のパッケージ
+    <pkg>www/apache2</pkg> をご覧ください。Apache では、設定ファイルを
+    <varname>PKG_SYSCONFBASE</varname> のサブディレクトリー
+    <filename>httpd/</filename> に置いています。この変数は、パッケージの
+    Makefile で設定します。</para>
   </listitem>
 
   <listitem>
-    <para><varname>PKG_SYSCONFVAR</varname>: Specifies the name of the
-    variable that holds this package's configuration directory (if
-    different from <varname>PKG_SYSCONFBASE</varname>).  It defaults to
-    <varname>PKGBASE</varname>'s value, and is always prefixed with
-    <literal>PKG_SYSCONFDIR</literal>.</para>
+    <para><varname>PKG_SYSCONFVAR</varname>: このパッケージの設定ディレクトリー
+    (<varname>PKG_SYSCONFBASE</varname> と異なる場合) を保持する変数の名前を指定します。
+    指定しなかった場合は、<varname>PKGBASE</varname> の値となります。
+    また、常に <literal>PKG_SYSCONFDIR</literal> が前につきます。</para>
   </listitem>
 
   <listitem>
-    <para><varname>PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</varname>: Holds the
-    directory where the configuration files for the package identified by
-    <varname>PKG_SYSCONFVAR</varname>'s shall be placed.</para>
+    <para><varname>PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</varname>:
+    <varname>PKG_SYSCONFVAR</varname>
+    で区別されるパッケージの設定ファイルをどのディレクトリーに置くかを保持します。</para>
   </listitem>
 
 </itemizedlist>
 
-<para>Based on the above variables, pkginstall determines the value of
-<varname>PKG_SYSCONFDIR</varname>, which is the <emphasis>only</emphasis>
-variable that can be used within a package to refer to its configuration
-directory.  The algorithm used to set its value is basically the
-following:</para>
+<para>以上の各変数をもとに、pkginstall は <varname>PKG_SYSCONFDIR</varname>
+の値を決めます。パッケージが設定ディレクトリーを参照するには、
+この <varname>PKG_SYSCONFDIR</varname> 変数<emphasis>だけ</emphasis>を使うことができます。
+この値の設定に使われるアルゴリズムは、
+基本的には以下のとおりです。</para>
 
 <orderedlist>
 
   <listitem>
-    <para>If <varname>PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</varname> is set,
-    its value is used.</para>
+    <para><varname>PKG_SYSCONFDIR.${PKG_SYSCONFVAR}</varname> が設定されている場合は、
+    この値が使われます。</para>
   </listitem>
 
   <listitem>
-    <para>If the previous variable is not defined but
-    <varname>PKG_SYSCONFSUBDIR</varname> is set in the package's
-    <filename>Makefile</filename>, the resulting value is
-    <filename>${PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR}</filename>.</para>
+    <para>前項の変数は定義されていないが、
+    <varname>PKG_SYSCONFSUBDIR</varname> がパッケージの
+    <filename>Makefile</filename> で設定されている場合は、
+    <filename>${PKG_SYSCONFBASE}/${PKG_SYSCONFSUBDIR}</filename> が使われます。</para>
   </listitem>
 
   <listitem>
-    <para>Otherwise, it is set to
-    <filename>${PKG_SYSCONFBASE}</filename>.</para>
+    <para>以上の場合以外は、
+    <filename>${PKG_SYSCONFBASE}</filename> に設定されます。</para>
   </listitem>
 
 </orderedlist>
 
-<para>It is worth mentioning that <filename>${PKG_SYSCONFDIR}</filename> is
-automatically added to <filename>OWN_DIRS</filename>.  See <xref
-linkend="dirs-outside-prefix" /> what this means.</para>
+<para>なお、<filename>${PKG_SYSCONFDIR}</filename> は自動的に
+<filename>OWN_DIRS</filename> に追加されることを断っておきます。この意味については、<xref
+linkend="dirs-outside-prefix" />をご覧ください。</para>
 
 </sect2>
 
 <!-- ================================================================== -->
 
 <sect2 id="conf-files-configure">
-<title>Telling the software were configuration files are</title>
+<title>ソフトウェアに設定ファイルの置き場所を教える</title>
 
-<para>Given that pkgsrc (and users!) expect configuration files to be in a
-known place, you need to teach each package where it shall install its
-files.  In some cases you will have to patch the package Makefiles to
-achieve it.  If you are lucky, though, it may be as easy as passing an
-extra flag to the configuration script; this is the case of GNU Autoconf
-generated files:</para>
+<para>pkgsrc (とユーザーも) が、設定ファイルを既知の場所に置くことを前提としている場合は、
+設定ファイルをインストールする場所を各パッケージに教えてやる必要があります。
+場合によっては、パッケージの Makefile を修正する必要があります。
+この修正は、運がよければ、
+コンフィギュレーションスクリプトに渡すフラグを追加する程度ですみます。
+これは、GNU Autoconf が生成したファイルの場合が該当します。</para>
 
 <programlisting>CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}</programlisting>
 
-<para>Note that this specifies where the package has to <emphasis>look
-for</emphasis> its configuration files, not where they will be originally
-installed (although the difference is never explicit,
-unfortunately).</para>
+<para>なお、ここで指定しているのは、
+パッケージが設定ファイルを<emphasis>探す</emphasis>必要のある場所であって、
+設定ファイルのもともとのインストール先ではありません (困った事に、
+両者ははっきり区別できませんが)。</para>
 
 </sect2>
 
 <!-- ================================================================== -->
 
 <sect2 id="conf-files-patching">
-<title>Patching installations</title>
+<title>インストールの過程を修正する</title>
 
-<para>As said before, pkginstall automatically handles configuration files.
-This means that <emphasis role="strong">the packages themselves must not
-touch the contents of <filename>${PKG_SYSCONFDIR}</filename>
-directly</emphasis>.  Bad news is that many software installation scripts
-will, out of the box, mess with the contents of that directory.  So what is
-the correct procedure to fix this issue?</para>
+<para>前述のとおり、pkginstall は設定ファイルを自動的に処理します。
+つまり、<emphasis role="strong">パッケージ本体側では、
+<filename>${PKG_SYSCONFDIR}</filename> の内容を直接いじってはいけない</emphasis>
+ことになります。まずいことに、多くのソフトウェアのインストール用スクリプトは、
+そのまま実行すると、このディレクトリーの内容に手を加えてしまいます。では、
+この問題を適切に直すにはどうすればいいのでしょうか?</para>
 
-<para>You must teach the package (usually by manually patching it) to
-install any configuration files under the examples hierarchy,
-<filename>share/examples/${PKGBASE}/</filename>.  This way, the
-<filename>PLIST</filename> registers them and the administrator always
-has the original copies available.</para>
+<para>パッケージに対して、すべての設定ファイルを examples
+階層 <filename>share/examples/${PKGBASE}/</filename> 以下にインストールするように
+(ふつうは、手でパッチを当てて) 指示する必要があります。こうすると、
+<filename>PLIST</filename> はこれらを登録します。
+また、管理者はインストールされたままの設定ファイルを常に使うことができます。</para>
 
-<para>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
-<filename>${PKG_SYSCONFDIR}</filename>.  To achieve this, the variables
-<varname>CONF_FILES</varname> and <varname>CONF_FILES_PERMS</varname> are
-used.  Check out <xref linkend="files-outside-prefix" /> for information
-about their syntax and their purpose.  Here is an example, taken from the
-<pkg>mail/mutt</pkg> package:</para>
+<para>必要な設定ファイルを適切な場所 (つまり、examples 階層の下) に置けば、
+pkginstall の枠組は、このファイルを、パッケージのインストール時に
+<filename>${PKG_SYSCONFDIR}</filename>
+以下のファイルを更新するための原本として使うことができます。これをおこなうために、
+<varname>CONF_FILES</varname> および <varname>CONF_FILES_PERMS</varname>
+の各変数が使われます。この各変数の書式と使い方は、
+<xref linkend="files-outside-prefix" />でご確認ください。
+<pkg>mail/mutt</pkg> パッケージから抜粋した例を以下に掲げます。</para>
 
 <programlisting>EGDIR=        ${PREFIX}/share/doc/mutt/samples
 CONF_FILES=   ${EGDIR}/Muttrc ${PKG_SYSCONFDIR}/Muttrc</programlisting>
 
-<para>Note that the <varname>EGDIR</varname> variable is specific to that
-package and has no meaning outside it.</para>
+<para>なお、<varname>EGDIR</varname> 変数は当該パッケージに特有のものであって、
+それ以外では意味を持たないことに注意してください。</para>
 
 </sect2>
 
 <!-- ================================================================== -->
 
 <sect2 id="conf-files-disable">
-<title>Disabling handling of configuration files</title>
+<title>設定ファイルの処理をしないようにする</title>
 
 <!-- XXX This doesn't really belong here -->
 
-<para>The automatic copying of config files can be toggled by setting the
-environment variable <varname>PKG_CONFIG</varname> prior to package
-installation.</para>
+<para>設定ファイルの自動コピーは、パッケージをインストールする前に環境変数
+<varname>PKG_CONFIG</varname> を設定しておけば、
+おこなうかどうかを切替えることができます。</para>
 
 </sect2>
 
@@ -329,39 +334,39 @@
 <!-- ================================================================== -->
 
 <sect1 id="rcd-scripts">
-<title>System startup scripts</title>
+<title>システム起動スクリプト</title>
 
-<para>System startup scripts are special files because they must be
-installed in a place known by the underlying OS, usually outside the
-installation prefix.  Therefore, the same rules described in <xref
-linkend="files-and-dirs-outside-prefix" /> apply, and the same solutions
-can be used.  However, pkginstall provides a special mechanism to handle
-these files.</para>
+<para>システムの起動スクリプトは、OS ごとに決まった場所にインストールする必要があり、
+その場所はたいていインストール用のプレフィックス以外の場所にある、という点で、
+特別なファイルです。したがって、<xref
+linkend="files-and-dirs-outside-prefix" />で説明したのと同じ方法を適用して、
+同じ解決法を使うことができます。ただし、
+pkginstall では起動スクリプトの処理専用の仕組みを用意しています。</para>
 
-<para>In order to provide system startup scripts, the package has
-to:</para>
+<para>システムの起動スクリプトが附属するパッケージでは、
+以下のことをおこなう必要があります。</para>
 
 <orderedlist>
 
   <listitem>
-    <para>Store the script inside <filename>${FILESDIR}</filename>, with
-    the <literal>.sh</literal> suffix appended.  Considering the
-    <pkg>print/cups</pkg> package as an example, it has a
-    <filename>cupsd.sh</filename> in its files directory.</para>
+    <para>スクリプトに <literal>.sh</literal> サフィックスを付け加えて、
+    <filename>${FILESDIR}</filename> 内に置きます。例としては、
+    files ディレクトリーに <filename>cupsd.sh</filename> がある
+    <pkg>print/cups</pkg> パッケージをご覧ください。</para>
   </listitem>
 
   <listitem>
-    <para>Tell pkginstall to handle it, appending the name of the script,
-    without its extension, to the <varname>RCD_SCRIPTS</varname> variable.
-    Continuing the previous example:</para>
+    <para>スクリプト名から拡張子を抜いたものを <varname>RCD_SCRIPTS</varname>
+    変数に追加して、pkginstall がこのスクリプトを処理するようにします。
+    前出の例では以下のようになります。</para>
 
     <programlisting>RCD_SCRIPTS+= cupsd</programlisting>
   </listitem>
 
 </orderedlist>
 
-<para>Once this is done, pkginstall will do the following steps for each
-script in an automated fashion:</para>
+<para>以上のことをおこなえば、pkginstall は各スクリプトに対して、
+以下の手順を自動的におこないます。</para>
 
 <!-- XXX We should probably have a chapter describing how rc.d scripts are
      written. -->
@@ -369,22 +374,22 @@
 <orderedlist>
 
   <listitem>
-    <para>Process the file found in the files directory applying all the
-    substitutions described in the <filename>FILES_SUBST</filename>
-    variable.</para>
+    <para>files ディレクトリー以下の各ファイルに対して、
+    <filename>FILES_SUBST</filename>
+    変数で示されている置換をすべて適用します。</para>
   </listitem>
 
   <listitem>
-    <para>Copy the script from the files directory to the examples
-    hierarchy, <filename>${PREFIX}/share/examples/rc.d/</filename>.  Note
-    that this master file must be explicitly registered in the
-    <filename>PLIST</filename>.</para>
+    <para>スクリプトを、files ディレクトリーから examples
+    階層 <filename>${PREFIX}/share/examples/rc.d/</filename> にコピーします。
+    なお、この原本ファイルは、<filename>PLIST</filename>
+    に明示的に登録する必要があります。</para>
   </listitem>
 
   <listitem>
-    <para>Add code to the installation scripts to copy the startup script
-    from the examples hierarchy into the system-wide startup scripts
-    directory.</para>
+    <para>起動スクリプトを examples
+    階層からシステム全体の起動スクリプト用ディレクトリーにコピーするためのコードを、
+    インストール用スクリプトに追加します。</para>
   </listitem>
 
 </orderedlist>
@@ -392,15 +397,15 @@
 <!-- ================================================================== -->
 
 <sect2 id="rcd-scripts-disable">
-<title>Disabling handling of system startup scripts</title>
+<title>システム起動スクリプトの処理をしないようにする</title>
 
 <!-- XXX This doesn't really belong here -->
 
-<para>The automatic copying of config files can be toggled by setting the
-environment variable <varname>PKG_RCD_SCRIPTS</varname> prior to package
-installation.  Note that the scripts will be always copied inside the
-examples hierarchy, <filename>${PREFIX}/share/examples/rc.d/</filename>, no
-matter what the value of this variable is.</para>
+<para>設定ファイルの自動コピーは、パッケージをインストールする前に環境変数
+<varname>PKG_RCD_SCRIPTS</varname> を設定しておけば、
+おこなうかどうかを切替えることができます。なお、起動スクリプトは常に
+examples 階層 <filename>${PREFIX}/share/examples/rc.d/</filename>
+にコピーされますが、これはこの変数値の影響を受けません。</para>
 
 </sect2>
 
@@ -409,52 +414,52 @@
 <!-- ================================================================== -->
 
 <sect1 id="users-and-groups">
-<title>System users and groups</title>
+<title>システムユーザーとグループ</title>
 
-<para>If a package needs to create special users and/or groups during
-installation, it can do so by using the pkginstall framework.</para>
+<para>パッケージのインストール時に、特別なユーザーやグループを作成する必要がある場合、
+pkginstall の枠組を使って作成することができます。</para>
 
-<para>Users can be created by adding entries to the
-<varname>PKG_USERS</varname> variable.  Each entry has the following
-syntax, which mimics <filename>/etc/passwd</filename>:</para>
+<para><varname>PKG_USERS</varname> 変数にユーザーのエントリーを追加すると、
+ユーザーを作ることができます。各エントリーは、
+以下のような、<filename>/etc/passwd</filename> に似た書式となります。</para>
 
 <programlisting>user:group[:[userid][:[descr][:[home][:shell]]]]</programlisting>
 
-<para>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
-<filename>/nonexistent</filename>, and login shell
-<filename>/sbin/nologin</filename> 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:</para>
+<para>user と group だけが必須です。それ以外はなくても構いませんが、
+書く場合はコロンを適切な場所に置く必要があります。
+ホームディレクトリーを指定しなかった場合は
+<filename>/nonexistent</filename> となり、ログインシェルを指定しなかった場合は
+<filename>/sbin/nologin</filename> となります。
+なお、description にスペースが入っている場合は、
+以下のように、バックスラッシュ 2 個でスペースをエスケープします。</para>
 
 <programlisting>foo:foogrp::The\\ Foomister</programlisting>
 
-<para>Similarly, groups can be created using the
-<varname>PKG_GROUPS</varname> variable, whose syntax is:</para>
+<para>同様にして、<varname>PKG_GROUPS</varname>
+変数を使ってグループを作ることができます。こちらの書式は以下のようになります。</para>
 
 <programlisting>group[:groupid]</programlisting>
 
-<para>As before, only the group name is required; the numeric identifier is
-optional.</para>
+<para>ユーザーと同様に、グループ名 (group) だけが必須であり、
+数字のグループ ID はなくても構いません。</para>
 
 </sect1>
 
 <!-- ================================================================== -->
 
 <sect1 id="shells">
-<title>System shells</title>
+<title>システムシェル</title>
 
-<para>Packages that install system shells should register them in the shell
-database, <filename>/etc/shells</filename>, to make things easier to the
-administrator.  This must be done from the installation scripts to keep
-binary packages working on any system.  pkginstall provides an easy way to
-accomplish this task.</para>
+<para>パッケージがシステムシェルをインストールする場合は、管理者の手間を減らせるよう、
+インストールしたシェルをシェルデータベース <filename>/etc/shells</filename>
+に登録するようにします。この登録は、どのシステム上でもバイナリーパッケージが機能するようにするため、
+インストール用スクリプトでおこなう必要があります。pkginstall では、
+このことを簡単に実現できる方法を用意しています。</para>
 
-<para>When a package provides a shell interpreter, it has to set the
-<varname>PKG_SHELL</varname> variable to its absolute file name.  This will
-add some hooks to the installation scripts to handle it.  Consider the
-following example, taken from <pkg>shells/zsh</pkg>:</para>
+<para>パッケージがシェルインタープリターを提供する場合は、
+<varname>PKG_SHELL</varname> 変数を、そのシェルの絶対ファイル名に設定する必要があります。
+こうすると、インストール用スクリプトに、シェル登録処理用のフックを追加します。
+<pkg>shells/zsh</pkg> から抜粋した例を以下に掲げますので、ご覧ください。</para>
 
 <programlisting>USE_PKGINSTALL= YES
 PKG_SHELL=      ${PREFIX}/bin/zsh</programlisting>
@@ -462,13 +467,13 @@
 <!-- ================================================================== -->
 
 <sect2 id="shells-disable">
-<title>Disabling handling of configuration files</title>
+<title>設定ファイルの処理をしないようにする</title>
 
 <!-- XXX This doesn't really belong here -->
 
-<para>The automatic registration of shell interpreters can be disabled by
-the administrator by setting the <filename>PKG_REGISTER_SHELLS</filename>
-environment variable to <literal>NO</literal>.</para>
+<para>シェルインタープリターの自動登録は、管理者が
+<filename>PKG_REGISTER_SHELLS</filename> 環境変数を <literal>NO</literal>
+に設定すれば、無効化することができます。</para>
 
 </sect2>