summaryrefslogtreecommitdiff
path: root/doc/guide/files/files.xml
blob: 7315ba88b5663736b91e601e5764aa25d7ebcccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<!-- $NetBSD: files.xml,v 1.4 2006/11/23 11:44:47 yyamano 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 <filename>mk.conf</filename>
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>