pkgsrc/doc/guide/files/files.xml
2007-08-15 06:33:43 +00:00

166 lines
6.2 KiB
XML

<!-- $NetBSD: files.xml,v 1.6 2007/08/15 06:33:45 rillig Exp $ -->
<chapter id="files">
<title>Directory layout of the installed files</title>
<para>The files that are installed by pkgsrc are organized in a way that
is similar to what you find in the <filename>/usr</filename> directory
of the base system. But some details are different. This is because
pkgsrc initially came from FreeBSD and had adopted its file system
hierarchy. Later it was largely influenced by NetBSD. But no matter
which operating system you are using pkgsrc with, you can expect the
same layout for pkgsrc.</para>
<para>There are mainly four root directories for pkgsrc, which are all
configurable in the <filename>bootstrap/bootstrap</filename> script.
When pkgsrc has been installed as root, the default locations
are:</para>
<programlisting>
LOCALBASE= /usr/pkg
PKG_SYSCONFBASE= /usr/pkg/etc
VARBASE= /var
PKG_DBDIR= /var/db/pkg
</programlisting>
<para>In unprivileged mode (when pkgsrc has been installed as any other
user), the default locations are:</para>
<programlisting>
LOCALBASE= ${HOME}/pkg
PKG_SYSCONFBASE= ${HOME}/pkg/etc
VARBASE= ${HOME}/pkg/var
PKG_DBDIR= ${HOME}/pkg/var/db/pkg
</programlisting>
<para>What these four directories are for, and what they look like is
explained below.</para>
<itemizedlist>
<listitem><para><varname>LOCALBASE</varname> corresponds to the
<filename>/usr</filename> directory in the base system. It is the
<quote>main</quote> directory where the files are installed and contains
the well-known subdirectories like <filename>bin</filename>,
<filename>include</filename>, <filename>lib</filename>,
<filename>share</filename> and
<filename>sbin</filename>.</para></listitem>
<listitem><para><varname>VARBASE</varname> corresponds to
<filename>/var</filename> in the base system. Some programs (especially
games, network daemons) need write access to it during normal
operation.</para></listitem>
<listitem><para><varname>PKG_SYSCONFDIR</varname> corresponds to
<filename>/etc</filename> in the base system. It contains configuration
files of the packages, as well as pkgsrc's &mk.conf;
itself.</para></listitem>
</itemizedlist>
<sect1 id="files.localbase">
<title>File system layout in <literal>${LOCALBASE}</literal></title>
<para>The following directories exist in a typical pkgsrc installation
in <filename>${LOCALBASE}</filename>.</para>
<variablelist>
<varlistentry><term><filename>bin</filename></term>
<listitem><para>Contains executable programs that are intended to be
directly used by the end user.</para></listitem></varlistentry>
<varlistentry><term><filename>emul</filename></term>
<listitem><para>Contains files for the emulation layers of various other
operating systems, especially for
NetBSD.</para></listitem></varlistentry>
<varlistentry><term><filename>etc</filename> (the usual location of
<filename>${PKG_SYSCONFDIR}</filename>)</term><listitem><para>Contains
the configuration files.</para></listitem></varlistentry>
<varlistentry><term><filename>include</filename></term>
<listitem><para>Contains headers for the C and C++ programming
languages.</para></listitem></varlistentry>
<varlistentry><term><filename>info</filename></term>
<listitem><para>Contains GNU info files of various
packages.</para></listitem></varlistentry>
<varlistentry><term><filename>lib</filename></term>
<listitem><para>Contains shared and static
libraries.</para></listitem></varlistentry>
<varlistentry><term><filename>libdata</filename></term>
<listitem><para>Contains data files that don't change after
installation. Other data files belong into
<filename>${VARBASE}</filename>.</para></listitem></varlistentry>
<varlistentry><term><filename>libexec</filename></term>
<listitem><para>Contains programs that are not intended to be used by
end users, such as helper programs or network
daemons.</para></listitem></varlistentry>
<varlistentry><term><filename>libexec/cgi-bin</filename></term>
<listitem><para>Contains programs that are intended to be executed as
CGI scripts by a web server.</para></listitem></varlistentry>
<varlistentry><term><filename>man</filename> (the usual value of
<filename>${PKGMANDIR}</filename>)</term><listitem><para>Contains brief
documentation in form of manual pages.</para></listitem></varlistentry>
<varlistentry><term><filename>sbin</filename></term>
<listitem><para>Contains programs that are intended to be used only by
the super-user.</para></listitem></varlistentry>
<varlistentry><term><filename>share</filename></term>
<listitem><para>Contains platform-independent data files that don't
change after installation.</para></listitem></varlistentry>
<varlistentry><term><filename>share/doc</filename></term>
<listitem><para>Contains documentation files provided by the
packages.</para></listitem></varlistentry>
<varlistentry><term><filename>share/examples</filename></term>
<listitem><para>Contains example files provided by the packages. Among
others, the original configuration files are saved here and copied to
<filename>${PKG_SYSCONFDIR}</filename> during
installation.</para></listitem></varlistentry>
<varlistentry><term><filename>share/examples/rc.d</filename></term>
<listitem><para>Contains the original files for rc.d
scripts.</para></listitem></varlistentry>
<varlistentry><term><filename>var</filename> (the usual location of
<filename>${VARBASE}</filename>)</term> <listitem><para>Contains files
that may be modified after
installation.</para></listitem></varlistentry>
</variablelist>
</sect1>
<sect1 id="files.varbase">
<title>File system layout in <literal>${VARBASE}</literal></title>
<variablelist>
<varlistentry><term><filename>db/pkg</filename> (the usual location of
<filename>${PKG_DBDIR}</filename>)</term><listitem><para>Contains
information about the currently installed
packages.</para></listitem></varlistentry>
<varlistentry><term><filename>games</filename></term>
<listitem><para>Contains highscore
files.</para></listitem></varlistentry>
<varlistentry><term><filename>log</filename></term>
<listitem><para>Contains log files.</para></listitem></varlistentry>
<varlistentry><term><filename>run</filename></term>
<listitem><para>Contains informational files about daemons that are
currently running.</para></listitem></varlistentry>
</variablelist>
</sect1>
</chapter>