summaryrefslogtreecommitdiff
path: root/doc/guide/files/configuring.xml
blob: 22470cc0b02b66d0a483a03b841a48e234b451e5 (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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!-- $NetBSD: configuring.xml,v 1.12 2006/02/28 11:50:07 rillig Exp $ -->

<chapter id="configuring">
  <title>Configuring pkgsrc</title>

  <sect1 id="general-configuration">
    <title>General configuration</title>

    <para>In this section, you can find some variables that apply to all
      pkgsrc packages.  The preferred method of setting these variables
      is by setting them in <filename>/etc/mk.conf</filename>.
      <itemizedlist>
	<listitem><para><varname>LOCALBASE</varname>: Where
	    packages will be installed. The default is
	    <filename>/usr/pkg</filename>. Do not mix binary packages
	    with different <varname>LOCALBASE</varname>s!</para>
	</listitem>
	<listitem><para><varname>CROSSBASE</varname>: Where
	    <quote>cross</quote> category packages will be
	    installed. The default is
	    <filename>${LOCALBASE}/cross</filename>.</para>
	</listitem>
	<listitem><para><varname>X11BASE</varname>: Where
	    X11 is installed on the system. The default is
	    <filename>/usr/X11R6</filename>.</para>
	</listitem>
	<listitem><para><varname>DISTDIR</varname>: Where to store the
	    downloaded copies of the original source distributions used
	    for building pkgsrc packages. The default is
	    <filename>${PKGSRCDIR}/distfiles</filename>.</para>
	</listitem>
	<listitem><para><varname>MASTER_SITE_OVERRIDE</varname>:
	    If set, override the packages'
	    <varname>MASTER_SITES</varname> with this value.</para>
	</listitem>
	<listitem><para><varname>MASTER_SITE_BACKUP</varname>:
	    Backup location(s) for distribution files and patch files
	    if not found locally or in
	    <filename>${MASTER_SITES}</filename> or
	    <filename>${PATCH_SITES}</filename> respectively.
	    The defaults are
	    <filename>ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/${DIST_SUBDIR}/</filename>
	    and
	    <filename>ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/</filename>.</para>
	</listitem>
	<listitem><para><varname>BINPKG_SITES</varname>:
	    List of sites carrying binary pkgs.</para>
	</listitem>
      </itemizedlist>
    </para>
  </sect1>

  <sect1 id="variables-affecting-build">
    <title>Variables affecting the build process</title>
    <para>XXX
      <itemizedlist>
	<listitem><para><varname>PACKAGES</varname>: The top level
	    directory for the binary packages. The default is
	    <filename>${PKGSRCDIR}/packages</filename>.</para>
	</listitem>
	<listitem><para><varname>WRKOBJDIR</varname>:
	    The top level directory where, if defined, the separate
	    working directories will get created, and symbolically
	    linked to from <filename>${WRKDIR}</filename> (see below).
	    This is useful for building packages on several
	    architectures, then <filename>${PKGSRCDIR}</filename>
	    can be NFS-mounted while <filename>${WRKOBJDIR}</filename>
	    is local to every architecture. (It should be noted that
	    <varname>PKGSRCDIR</varname> should not be set by the user
	    &mdash; it is an internal definition which refers to the
	    root of the pkgsrc tree. It is possible to have many
	    pkgsrc tree instances.)</para>
	</listitem>
	<listitem><para><varname>LOCALPATCHES</varname>:
	    Directory for local patches that aren't part of pkgsrc.
	    See <xref linkend="components.patches" /> for more
	    information. <replaceable>rel</replaceable> and
	    <replaceable>arch</replaceable> are replaced with OS
	    release (<quote>2.0</quote>, etc.) and architecture
	    (<quote>mipsel</quote>, etc.).</para>
	</listitem>
	<listitem><para><varname>PKGMAKECONF</varname>: Location of
	    the <filename>mk.conf</filename> file used by a package's
	    BSD-style Makefile. If this is not set,
	    <varname>MAKECONF</varname> is set to
	    <filename>/dev/null</filename> to avoid picking up
	    settings used by builds in <filename>/usr/src</filename>.</para>
	</listitem>
	<!--	DISTDIR -->
	<!--	FAILOVER_FETCH -->
      </itemizedlist>
    </para>
  </sect1>

  <!-- Compiler settings -->
  <!--	PKGSRC_COMPILER -->
  <!--	CFLAGS -->

  <!-- Configuration files -->
  <!--	PKG_SYSCONFBASE -->
  <!--	PKG_SYSCONFDIR.foobar -->

  <!-- Security -->
  <!--	PKGVULNDIR -->

  <sect1 id="developer-advanced-settings">
    <title>Developer/advanced settings</title>

    <!--	IGNORE_RECOMMENDED -->
    <para>XXX
      <itemizedlist>
	<listitem><para><varname>PKG_DEVELOPER</varname>:
	    Run some sanity checks that package developers want:
	    <itemizedlist>
	      <listitem><para>make sure patches apply with zero fuzz</para></listitem>
	      <listitem><para>run check-shlibs to see that all binaries will
		find their shared libs.</para>
	      <!-- XXX: some more stuff -->
	      </listitem>
	    </itemizedlist>
	  </para>
	</listitem>
	<listitem><para><varname>PKG_DEBUG_LEVEL</varname>:
	    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 <command>set -x</command>
	    will be displayed.</para></listitem>
	<listitem><para><varname>ALLOW_VULNERABILITIES.<replaceable>pkgbase</replaceable></varname>:
	    A space separated list of vulnerability IDs that may be ignored when
		performing the automated security checks.  These IDs are listed in the
		pkg-vulnerabilities file and are displayed by
		<command>audit-packages</command> when
		it finds a vulnerable package.
	  </para>
	</listitem>
	<listitem><para><varname>SKIP_AUDIT_PACKAGES</varname>:
	    If this is set to <quote>yes</quote>, the automated security checks
		(which use the <filename role="pkg">security/audit-packages</filename>
		package) will be <emphasis role="strong">entirely</emphasis> skipped
		for <emphasis role="strong">all</emphasis> packages built.  Normally
		you'll want to use ALLOW_VULNERABILITIES instead of this.
	  </para>
	</listitem>
      </itemizedlist>
    </para>
  </sect1>

  <!-- pkginstall-related variables -->
  <!--	PKG_REGISTER_SHELLS -->
  <!--	PKG_RCD_SCRIPTS -->

  <sect1 id="selecting-build-options">
    <title>Selecting Build Options</title>

    <para>Some packages have build time options, usually to select between
      different dependencies, enable optional support for big dependencies
      or enable experimental features.</para>

    <para>To see which options, if any, a package supports, and which
      options are mutually exclusive, run <command>make show-options</command>,
      for example:</para>

<programlisting>
    The following options are supported by this package:
        ssl      Enable SSL support.
    Exactly one of the following gecko options is required:
        firefox  Use firefox as gecko rendering engine.
        mozilla  Use mozilla as gecko rendering engine.
    At most one of the following database options may be selected:
        mysql    Enable support for MySQL database.
        pgsql    Enable support for PostgreSQL database.

    These options are enabled by default: firefox
    These options are currently enabled: mozilla ssl
</programlisting>

    <para>The following variables can be defined in
      <filename>/etc/mk.conf</filename> to select which options to enable
      for a package: <varname>PKG_DEFAULT_OPTIONS</varname>, which can be
      used to select or disable options for all packages that support them,
      and <varname>PKG_OPTIONS.<replaceable>pkgbase</replaceable></varname>,
      which can be used to select or disable options specifically for
      package <replaceable>pkgbase</replaceable>.  Options listed in these
      variables are selected, options preceded by <quote>-</quote> are
      disabled. A few examples:</para>

    <screen>
&uprompt; <command>grep "PKG.*OPTION" /etc/mk.conf</command>
PKG_DEFAULT_OPTIONS=    -arts -dvdread -esound
PKG_OPTIONS.kdebase=    debug -sasl
PKG_OPTIONS.apache=     suexec </screen>

    <para>The following settings are consulted in the order given, and the
      last setting that selects or disables an option is used:</para>

    <orderedlist>
      <listitem><para>the default options as suggested by the package
	  maintainer</para></listitem>

      <listitem><para>the options implied by the settings of legacy
	  variables (see below)</para></listitem>

      <listitem><para><varname>PKG_DEFAULT_OPTIONS</varname></para></listitem>

      <listitem><para><varname>PKG_OPTIONS.<replaceable>pkgbase</replaceable></varname></para></listitem>
    </orderedlist>

    <para>For groups of mutually exclusive options, the last option
      selected is used, all others are automatically disabled.  If an option
      of the group is explicitly disabled, the previously selected option,
      if any, is used.  It is an error if no option from a required group of
      options is selected, and building the package will fail.</para>

    <para>Before the options framework was introduced, build options were
      selected by setting a variable (often named
      <varname>USE_<replaceable>FOO</replaceable></varname>) in
      <filename>/etc/mk.conf</filename> for each option.  To ease transition
      to the options framework for the user, these legacy variables are
      converted to the appropriate options setting
      (<varname>PKG_OPTIONS.<replaceable>pkgbase</replaceable></varname>)
      automatically.  A warning is issued to prompt the user to
      update <filename>/etc/mk.conf</filename> to use the options framework
      directly.  Support for the legacy variables will be removed
      eventually.</para>
  </sect1>

</chapter>