Add QA_AM_MAINTAINER_MODE for bug #450278.
[portage.git] / man / ebuild.5
1 .TH "EBUILD" "5" "Jan 2013" "Portage VERSION" "Portage"
2
3 .SH "NAME"
4 ebuild \- the internal format, variables, and functions in an ebuild script
5
6 .SH "DESCRIPTION"
7 The \fBebuild\fR(1) program accepts a single ebuild script as an argument.
8 This script contains variables and commands that specify how to download,
9 unpack, patch, compile, install and merge a particular software package from
10 its original sources.  In addition to all of this, the ebuild script can also
11 contain pre/post install/remove commands, as required.  All ebuild scripts are
12 written in bash.
13
14 .SS "Dependencies"
15 A \fIdepend atom\fR is simply a dependency that is used by portage when calculating
16 relationships between packages.  Please note that if the atom has not already
17 been emerged, then the latest version available is matched.
18 .TP
19 .B Atom Bases
20 The base atom is just a full category/packagename.
21
22 Examples:
23 .nf
24 .I      sys\-apps/sed
25 .I      sys\-libs/zlib
26 .I      net\-misc/dhcp
27 .fi
28 .TP
29 .B Atom Versions
30 It is nice to be more specific and say that only certain versions of atoms are
31 acceptable.  Note that versions must be combined with a prefix (see below).  
32 Hence you may add a version number as a postfix to the base.
33
34 Examples:
35 .nf
36         sys\-apps/sed\fI\-4.0.5\fR
37         sys\-libs/zlib\fI\-1.1.4\-r1\fR
38         net\-misc/dhcp\fI\-3.0_p2\fR
39 .fi
40
41 Versions are normally made up of two or three numbers separated by periods, such
42 as 1.2 or 4.5.2.  This string may be followed by a character such as 1.2a or 
43 4.5.2z.  Note that this letter is \fInot\fR meant to indicate alpha, beta,
44 etc... status.  For that, use the optional suffix; either _alpha, _beta, _pre 
45 (pre\-release), _rc (release candidate), or _p (patch).  This means for the 
46 3rd pre\-release of a package, you would use something like 1.2_pre3.  The 
47 suffixes here can be arbitrarily chained without limitation.
48 .TP
49 .B Atom Prefix Operators [> >= = <= <]
50 Sometimes you want to be able to depend on general versions rather than specifying
51 exact versions all the time.  Hence we provide standard boolean operators:
52
53 Examples:
54 .nf
55         \fI>\fRmedia\-libs/libgd\-1.6
56         \fI>=\fRmedia\-libs/libgd\-1.6
57         \fI=\fRmedia\-libs/libgd\-1.6
58         \fI<=\fRmedia\-libs/libgd\-1.6
59         \fI<\fRmedia\-libs/libgd\-1.6
60 .fi
61 .TP
62 .B Extended Atom Prefixes [!~] and Postfixes [*]
63 Now to get even fancier, we provide the ability to define blocking packages and
64 version range matching.  Also note that these extended prefixes/postfixes may
65 be combined in any way with the atom classes defined above.
66 .RS
67 .TP
68 .I ~
69 means match any revision of the base version specified.  So in the
70 example below, we would match versions '1.0.2a', '1.0.2a\-r1', '1.0.2a\-r2',
71 etc...
72
73 Example:
74 .nf
75         \fI~\fRnet\-libs/libnet\-1.0.2a
76 .fi
77 .TP
78 .I !
79 means block packages from being installed at the same time.
80
81 Example:
82 .nf
83         \fI!\fRapp\-text/dos2unix
84 .fi
85 .TP
86 .I !!
87 means block packages from being installed at the same time
88 and explicitly disallow them from being temporarily installed
89 simultaneously during a series of upgrades. This syntax is supported
90 beginning with \fBEAPI 2\fR.
91
92 Example:
93 .nf
94         \fI!!\fR<sys\-apps/portage\-2.1.4_rc1
95 .fi
96 .TP
97 .I *
98 means match any version of the package so long
99 as the specified string prefix is matched. So with a
100 version of '2*', we can match '2.1', '2.2', '2.2.1',
101 etc... and not match version '1.0', '3.0', '4.1', etc...
102 Beware that, due to the string matching nature, '20'
103 will also be matched by '2*'. The version part
104 that comes before the '*' must be a valid version in the absence of the '*'.
105 For example, '2' is a valid version and '2.' is not. Therefore, '2*' is
106 allowed and '2.*' is not.
107
108 Examples:
109 .nf
110         =dev\-libs/glib\-2\fI*\fR
111         \fI!\fR=net\-fs/samba\-2\fI*\fR
112 .fi
113 .RE
114 .TP
115 .B Atom Slots
116 Beginning with \fBEAPI 1\fR, any atom can be constrained to match a specific
117 \fBSLOT\fR. This is accomplished by appending a colon followed by a
118 \fBSLOT\fR:
119
120 Examples:
121 .nf
122         x11\-libs/qt:3
123         \fI~\fRx11\-libs/qt-3.3.8:3
124         \fI>=\fRx11\-libs/qt-3.3.8:3
125         \fI=\fRx11\-libs/qt-3.3*:3
126 .fi
127 .TP
128 .B Sub Slots
129 Beginning with \fBEAPI 5\fR, a slot dependency may contain an
130 optional sub\-slot part that follows the regular slot and is
131 delimited by a \fI/\fR character.
132
133 Examples:
134 .nf
135         dev\-libs/icu:0/0
136         dev\-libs/icu:0/49
137         dev\-lang/perl:0/5.12
138         dev\-libs/glib:2/2.30
139 .fi
140 .TP
141 .B Atom Slot Operators
142 Beginning with \fBEAPI 5\fR, slot operator dependency consists
143 of a colon followed by one of the following operators:
144 .RS
145 .TP
146 .I *
147 Indicates that any slot value is acceptable. In addition,
148 for runtime dependencies, indicates that the package will not
149 break if the matched package is uninstalled and replaced by
150 a different matching package in a different slot.
151
152 Examples:
153 .nf
154         dev\-libs/icu:*
155         dev\-lang/perl:*
156         dev-libs/glib:*
157 .fi
158 .TP
159 .I =
160 Indicates that any slot value is acceptable. In addition,
161 for runtime dependencies, indicates that the package will
162 break unless a matching package with slot and sub\-slot equal
163 to the slot and sub\-slot of the best installed version at the
164 time the package was installed is available.
165
166 Examples:
167 .nf
168         dev\-libs/icu:=
169         dev\-lang/perl:=
170         dev-libs/glib:=
171 .fi
172 .TP
173 .I slot=
174 Indicates that only a specific slot value is acceptable, and
175 otherwise behaves identically to the plain equals slot operator.
176
177 Examples:
178 .nf
179         dev\-libs/icu:0=
180         dev\-lang/perl:0=
181         dev-libs/glib:2=
182 .fi
183 .PP
184 To implement the equals slot operator, the package manager
185 will need to store the slot/sub\-slot pair of the best installed
186 version of the matching package. This syntax is only for package
187 manager use and must not be used by ebuilds. The package manager
188 may do this by inserting the appropriate slot/sub\-slot pair
189 between the colon and equals sign when saving the package's
190 dependencies. The sub\-slot part must not be omitted here
191 (when the SLOT variable omits the sub\-slot part, the package
192 is considered to have an implicit sub\-slot which is equal to
193 the regular slot).
194
195 Examples:
196 .nf
197         dev\-libs/icu:0/0=
198         dev\-libs/icu:0/49=
199         dev\-lang/perl:0/5.12=
200         dev-libs/glib:2/2.30=
201 .fi
202 .RE
203 .TP
204 .B Atom USE
205 Beginning with \fBEAPI 2\fR, any atom can be constrained to match specific
206 \fBUSE\fR flag settings. When used together with \fBSLOT\fR dependencies,
207 \fBUSE\fR dependencies appear on the right hand side of \fBSLOT\fR
208 dependencies.
209 .RS
210 .TP
211 .B Unconditional USE Dependencies
212 .TS
213 l l
214 __
215 l l.
216 Example Meaning
217 foo[bar]        foo must have bar enabled
218 foo[bar,baz]    foo must have both bar and baz enabled
219 foo[\-bar,baz]  foo must have bar disabled and baz enabled
220 .TE
221 .TP
222 .B Conditional USE Dependencies
223 .TS
224 l l
225 __
226 l l.
227 Compact Form    Equivalent Expanded Form
228 foo[bar?]       bar? ( foo[bar] ) !bar? ( foo )
229 foo[!bar?]      bar? ( foo ) !bar? ( foo[\-bar] )
230 foo[bar=]       bar? ( foo[bar] ) !bar? ( foo[\-bar] )
231 foo[!bar=]      bar? ( foo[\-bar] ) !bar? ( foo[bar] )
232 .TE
233 .RE
234 .TP
235 .B Atom USE defaults
236 Beginning with \fBEAPI 4\fR, \fBUSE\fR dependencies may specify default
237 assumptions about values for flags that may or may not be missing from
238 the \fBIUSE\fR of the matched package. Such defaults are specified by
239 immediately following a flag with either \fI(+)\fR or \fI(\-)\fR. Use
240 \fI(+)\fR to behave as if a missing flag is present and enabled, or
241 \fI(\-)\fR to behave as if it is present and disabled:
242
243 Examples:
244 .nf
245         media\-video/ffmpeg[threads(+)]
246         media\-video/ffmpeg[-threads(\-)]
247 .fi
248 .TP
249 .B Dynamic Dependencies
250 Sometimes programs may depend on different things depending on the USE
251 variable.  Portage offers a few options to handle this.  Note that when
252 using the following syntaxes, each case is considered as 1 Atom in the
253 scope it appears.  That means that each Atom both conditionally include
254 multiple Atoms and be nested to an infinite depth.
255 .RS
256 .TP
257 .B usevar? ( Atom )
258 To include the jpeg library when the user has jpeg in \fBUSE\fR, simply use the
259 following syntax:
260
261 jpeg? ( media\-libs/jpeg )
262 .TP
263 .B !usevar? ( Atom )
264 If you want to include a package only if the user does not have a certain option
265 in their \fBUSE\fR variable, then use the following syntax:
266
267 !nophysfs? ( dev\-games/physfs )
268
269 This is often useful for those times when you want to want to add optional support
270 for a feature and have it enabled by default.
271 .TP
272 .B usevar? ( Atom if true ) !usevar? ( Atom if false )
273 For functionality like the tertiary operator found in C you must use
274 two statements, one normal and one inverted.  If a package uses
275 GTK2 or GTK1, but not both, then you can handle that like this:
276
277 gtk2? ( =x11\-libs/gtk+\-2* ) !gtk2? ( =x11\-libs/gtk+\-1* )
278
279 That way the default is the superior GTK2 library.
280 .TP
281 .B || ( Atom Atom ... )
282 When a package can work with a few different packages but a virtual is not
283 appropriate, this syntax can easily be used.
284
285 Example:
286 .nf
287 || (
288         app\-games/unreal\-tournament
289         app\-games/unreal\-tournament\-goty
290 )
291 .fi
292
293 Here we see that unreal\-tournament has a normal version and it has a goty
294 version.  Since they provide the same base set of files, another package can
295 use either.  Adding a virtual is inappropriate due to the small scope of it.
296
297 Another good example is when a package can be built with multiple video
298 interfaces, but it can only ever have just one.
299
300 Example:
301 .nf
302 || (
303         sdl? ( media\-libs/libsdl )
304         svga? ( media\-libs/svgalib )
305         opengl? ( virtual/opengl )
306         ggi? ( media\-libs/libggi )
307         virtual/x11
308 )
309 .fi
310
311 Here only one of the packages will be chosen, and the order of preference is
312 determined by the order in which they appear.  So sdl has the best chance of
313 being chosen, followed by svga, then opengl, then ggi, with a default of X if
314 the user does not specify any of the previous choices.
315
316 Note that if any of the packages listed are already merged, the package manager
317 will use that to consider the dependency satisfied.
318
319 .SS "Cross-compilation"
320 Portage supports cross-compilation into a subdirectory specified by \fBROOT\fR.
321 .TP
322 .B Host
323 \fIHost\fR in this context means the platform hosting the build process, i.e.
324 what autotools calls CBUILD.
325 Its packages are contained in the root of the filesystem ("\fI/\fR").
326
327 If \fBROOT\fR is "\fI/\fR", all dependency types will be installed there.
328 Otherwise, for EAPIs that support \fBHDEPEND\fR (experimental
329 \fBEAPI 5-hdepend\fR), only \fBHDEPEND\fR is installed into "\fI/\fR".
330 For EAPIs that do not support \fBHDEPEND\fR, the behaviour is controlled by the
331 \fI\-\-root-deps\fR flag to \fBemerge\fR(1), defaulting to install only
332 \fBDEPEND\fR into the \fIhost\fR.
333 .TP
334 .B Target
335 \fITarget\fR refers to the platform that the package will later run on, i.e.
336 what autotools calls CHOST.
337 The directory housing this system is specified by \fBROOT\fR.
338 If it is different from "\fI/\fR", i.e. \fIhost\fR and \fItarget\fR are not the
339 same, this variable contains the path to the directory housing the \fItarget\fR
340 system.
341
342 For EAPIs that support \fBHDEPEND\fR (experimental \fBEAPI 5-hdepend\fR),
343 \fBDEPEND\fR, \fBRDEPEND\fR, and \fBPDEPEND\fR
344 list the \fItarget\fR dependencies, i.e. those to be installed into \fBROOT\fR.
345 For EAPIs that do not support \fBHDEPEND\fR, the \fBemerge\fR(1) flag
346 \fI\-\-root-deps\fR controls what the package manager installs there.
347 Without it, \fBemerge\fR defaults to install only runtime dependencies (i.e.
348 \fBRDEPEND\fR and \fBPDEPEND\fR) into \fBROOT\fR.
349 .PP
350 See section \fBVARIABLES\fR for more information about the \fBDEPEND\fR,
351 \fBRDEPEND\fR and \fBHDEPEND\fR variables.
352 .TP
353 .B The targetroot USE flag
354 For EAPIs that support the "\fItargetroot\fR" USE flag, that flag is
355 automatically enabled by the package manager if \fIhost\fR and \fItarget\fR
356 system are not the same, i.e. if the \fBROOT\fR is not "\fI/\fR".
357 This is necessary where the package to be built needs an executable copy of
358 itself during the build process.
359 A known example is dev-lang/python, which needs to run a Python interpreter
360 during compilation.
361
362 .SH "VARIABLES"
363 .TP
364 .B Usage Notes
365 \- All variables defined in \fBmake.conf\fR(5) are available for use in
366 ebuilds (such as the PORTAGE* and PORTDIR* variables)
367 .br
368 \- When assigning values to variables in ebuilds, you \fIcannot have a
369 space\fR between the variable name and the equal sign.
370 .br
371 \- Variable values should only contain characters that are members of the
372 \fBascii\fR(7) character set. This requirement is mandated by \fBGLEP 31\fR.
373 .TP
374 .B P
375 This variable contains the package name without the ebuild revision.
376 This variable must NEVER be modified.
377
378 xfree\-4.2.1\-r2.ebuild \-\-> $P=='xfree\-4.2.1'
379 .TP
380 .B PN
381 Contains the name of the script without the version number.
382
383 xfree\-4.2.1\-r2.ebuild \-\-> $PN=='xfree'
384 .TP
385 .B PV
386 Contains the version number without the revision.
387
388 xfree\-4.2.1\-r2.ebuild \-\-> $PV=='4.2.1'
389 .TP
390 .B PR
391 Contains the revision number or 'r0' if no revision number exists.
392
393 xfree\-4.2.1\-r2.ebuild \-\-> $PR=='r2'
394 .TP
395 .B PVR
396 Contains the version number with the revision.
397
398 xfree\-4.2.1\-r2.ebuild \-\-> $PVR=='4.2.1\-r2'
399 .TP
400 .B PF
401 Contains the full package name \fBPN\fR\-\fBPVR\fR
402
403 xfree\-4.2.1\-r2.ebuild \-\-> $PF=='xfree\-4.2.1\-r2'
404 .TP
405 .B CATEGORY
406 Contains the package category name.
407 .TP
408 .B A
409 Contains all source files required for the package.  This variable must
410 not be defined. It is autogenerated from the \fBSRC_URI\fR variable.
411 .TP
412 .B WORKDIR\fR = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/work"
413 Contains the path to the package build root.  Do not modify this variable.
414 .TP
415 .B FILESDIR\fR = \fI"${PORTDIR}/${CATEGORY}/${PN}/files"
416 Contains the path to the 'files' sub folder in the package specific
417 location in the portage tree.  Do not modify this variable.
418 .TP
419 .B EBUILD_PHASE
420 Contains the abreviated name of the phase function that is
421 currently executing, such as "setup", "unpack", "compile", or
422 "preinst".
423 .TP
424 .B EBUILD_PHASE_FUNC
425 Beginning with \fBEAPI 5\fR, contains the full name of the phase
426 function that is currently executing, such as "pkg_setup",
427 "src_unpack", "src_compile", or "pkg_preinst".
428 .TP
429 .B EPREFIX
430 Beginning with \fBEAPI 3\fR, contains the offset
431 that this Portage was configured for during
432 installation.  The offset is sometimes necessary in an ebuild or eclass,
433 and is available in such cases as ${EPREFIX}.  EPREFIX does not contain
434 a trailing slash, therefore an absent offset is represented by the empty
435 string.  Do not modify this variable.
436 .TP
437 .B S\fR = \fI"${WORKDIR}/${P}"
438 Contains the path to the temporary \fIbuild directory\fR.  This variable
439 is used by the functions \fIsrc_compile\fR and \fIsrc_install\fR.  Both
440 are executed with \fIS\fR as the current directory.  This variable may
441 be modified to match the extraction directory of a tarball for the package.
442 .TP
443 .B T\fR = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/temp"
444 Contains the path to a \fItemporary directory\fR.  You may use this for
445 whatever you like.
446 .TP
447 .B D\fR = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/image/"
448 Contains the path to the temporary \fIinstall directory\fR.  Every write
449 operation that does not involve the helper tools and functions (found below)
450 should be prefixed with ${D}.
451 Beginning with \fBEAPI 3\fR, the offset prefix often needs
452 to be taken into account here, for which the variable
453 ${ED} is provided (see below).
454 Do not modify this variable.
455 .TP
456 .B ED\fR = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/image/${EPREFIX}/"
457 Beginning with \fBEAPI 3\fR, contains the path
458 "${D%/}${EPREFIX}/" for convenience purposes.
459 For EAPI values prior to \fBEAPI 3\fR which do
460 not support ED, helpers use \fBD\fR where
461 they would otherwise use ED.
462 Do not modify this variable.
463 .TP
464 .B MERGE_TYPE
465 Beginning with \fBEAPI 4\fR, the MERGE_TYPE variable can be used to
466 query the current merge type. This variable will contain one of the
467 following possible values:
468
469 .RS
470 .TS
471 l l
472 __
473 l l.
474 Value   Meaning
475 binary  previously\-built which is scheduled for merge
476 buildonly       source\-build which is not scheduled for merge
477 source  source\-build which is scheduled for merge
478 .TE
479 .RE
480 .TP
481 .B PORTAGE_LOG_FILE
482 Contains the path of the build log. If \fBPORT_LOGDIR\fR variable is unset then
483 PORTAGE_LOG_FILE=\fI"${T}/build.log"\fR.
484 .TP
485 .B REPLACED_BY_VERSION
486 Beginning with \fBEAPI 4\fR, the REPLACED_BY_VERSION variable can be
487 used in pkg_prerm and pkg_postrm to query the package version that
488 is replacing the current package. If there is no replacement package,
489 the variable will be empty, otherwise it will contain a single version
490 number.
491 .TP
492 .B REPLACING_VERSIONS
493 Beginning with \fBEAPI 4\fR, the REPLACING_VERSIONS variable can be
494 used in pkg_pretend, pkg_setup, pkg_preinst and pkg_postinst to query
495 the package version(s) that the current package is replacing. If there
496 are no packages to replace, the variable will be empty, otherwise it
497 will contain a space\-separated list of version numbers corresponding
498 to the package version(s) being replaced. Typically, this variable will
499 not contain more than one version, but according to PMS it can contain
500 more.
501 .TP
502 .B ROOT\fR = \fI"/"
503 Contains the path that portage should use as the root of the live filesystem.
504 When packages wish to make changes to the live filesystem, they should do so in
505 the tree prefixed by ${ROOT}.  Often the offset prefix needs to be taken
506 into account here, for which the variable ${EROOT} is provided (see
507 below).  Do not modify this variable.
508 .TP
509 .B EROOT\fR = \fI"${ROOT%/}${EPREFIX}/"
510 Beginning with \fBEAPI 3\fR, contains
511 "${ROOT%/}${EPREFIX}/" for convenience
512 purposes. Do not modify this variable.
513 .TP
514 .B DESCRIPTION\fR = \fI"A happy little package"
515 Should contain a short description of the package.
516 .TP
517 .B EAPI\fR = \fI"0"
518 Defines the ebuild API version to which this package conforms. If not
519 defined then it defaults to "0". If portage does not recognize the
520 EAPI value then it will mask the package and refuse to perform any
521 operations with it since this means that a newer version of portage
522 needs to be installed first. For maximum backward compatiblity, a
523 package should conform to the lowest possible EAPI. Note that anyone
524 who uses the \fBebuild\fR(1) and \fBrepoman\fR(1) commands with this
525 package will be required to have a version of portage that recognizes
526 the EAPI to which this package conforms.
527 .TP
528 .B SRC_URI\fR = \fI"http://example.com/path/${P}.tar.gz"
529 Contains a list of URIs for the required source files.  It can contain
530 multiple URIs for a single source file.  The list is processed in order
531 if the file was not found on any of the \fIGENTOO_MIRRORS\fR.
532 Beginning with \fBEAPI 2\fR, the output file name of a given URI may be
533 customized with a "->" operator on the right hand side, followed by the
534 desired output file name. All tokens, including the operator and output
535 file name, should be separated by whitespace.
536 .TP
537 .B HOMEPAGE\fR = \fI"http://example.com/"
538 Should contain a list of URIs for the sources main sites and other further
539 package dependent information.
540 .TP
541 .B KEYWORDS\fR = \fI[\-~][x86,ppc,sparc,mips,alpha,arm,hppa]
542 Should contain appropriate list of arches that the ebuild is know to
543 work/not work.  By default if you do not know if an ebuild runs under
544 a particular arch simply omit that KEYWORD.  If the ebuild will not
545 work on that arch include it as \-ppc for example.  If the ebuild is
546 being submitted for inclusion, it must have ~arch set for architectures
547 where it has been PROVEN TO WORK.  (Packages KEYWORDed this way may be
548 unmasked for testing by setting ACCEPT_KEYWORDS="~arch" on the command
549 line, or in \fBmake.conf\fR(5)) For an authoritative list please review
550 /usr/portage/profiles/arch.list.  Please keep this list in alphabetical order.
551 .TP
552 .B SLOT
553 This sets the SLOT for packages that may need to have multiple versions
554 co\-exist.  By default you should set \fBSLOT\fR="0".  If you are unsure, then
555 do not fiddle with this until you seek some guidance from some guru.  This
556 value should \fINEVER\fR be left undefined.
557
558 Beginning with \fBEAPI 5\fR, the SLOT variable may contain
559 an optional sub\-slot part that follows the regular slot and
560 is delimited by a / character. The sub\-slot must be a valid
561 slot name. The sub\-slot is used to represent cases in which
562 an upgrade to a new version of a package with a different
563 sub\-slot may require dependent packages to be rebuilt. When
564 the sub\-slot part is omitted from the SLOT definition, the
565 package is considered to have an implicit sub\-slot which is
566 equal to the regular slot. Refer to the \fBAtom Slot
567 Operators\fR section for more information about sub\-slot
568 usage.
569 .TP
570 .B LICENSE
571 This should be a space delimited list of licenses that the package falls
572 under.  This \fB_must_\fR be set to a matching license in
573 /usr/portage/licenses/. If the license does not exist in portage yet, you
574 must add it first.
575 .TP
576 .B IUSE
577 This should be a list of any and all USE flags that are leveraged within
578 your build script.  The only USE flags that should not be listed here are
579 arch related flags (see \fBKEYWORDS\fR). Beginning with \fBEAPI 1\fR, it
580 is possible to prefix flags with + or - in order to create default settings
581 that respectively enable or disable the corresponding \fBUSE\fR flags. For
582 details about \fBUSE\fR flag stacking order, refer to the \fBUSE_ORDER\fR
583 variable in \fBmake.conf\fR(5). Given the default \fBUSE_ORDER\fR setting,
584 negative IUSE default settings are effective only for negation of
585 repo\-level USE settings, since profile and user configuration settings
586 override them.
587 .TP
588 .B DEPEND
589 This should contain a list of all packages that are required for the program
590 to compile (aka \fIbuildtime\fR dependencies).  These are usually libraries and
591 headers.
592
593 Starting from experimental \fBEAPI 5-hdepend\fR, tools should go into the
594 \fBHDEPEND\fR variable instead, as \fBDEPEND\fR will only be installed into the
595 \fItarget\fR system and hence cannot be executed in a cross\-compile setting.
596 (See section \fBCross\-compilation\fR for more information.)
597
598 You may use the syntax described above in the \fBDependencies\fR section.
599 .TP
600 .B RDEPEND
601 This should contain a list of all packages that are required for this
602 program to run (aka \fIruntime\fR dependencies).  These are usually libraries.
603
604 In \fBEAPI 3\fR or earlier, if this is not set, then it defaults to the value
605 of \fBDEPEND\fR. In \fBEAPI 4\fR or later, \fBRDEPEND\fR will never be
606 implicitly set.
607
608 You may use the syntax described above in the \fBDependencies\fR section.
609 .TP
610 .B HDEPEND
611 This should contain a list of all packages that are required to be executable
612 during compilation of this program (aka \fIhost\fR buildtime dependencies).
613 These are usually tools, like interpreters or (cross\-)compilers.
614
615 This variable is new in experimental \fBEAPI 5-hdepend\fR and will be installed
616 into the \fIhost\fR system.
617 (See section \fBCross-compilation\fR for more information.)
618
619 You may use the syntax described above in the \fBDependencies\fR section.
620 .TP
621 .B PDEPEND
622 This should contain a list of all packages that should be merged after this
623 one (aka \fIpost\fR merge dependencies), but which may be installed by the
624 package manager at any time, if that is not possible.
625
626 .B ***WARNING***
627 .br
628 Use this only as last resort to break cyclic dependencies!
629
630 You may use the syntax described above in the \fBDependencies\fR section.
631 .TP
632 .B REQUIRED_USE
633 Beginning with \fBEAPI 4\fR, the \fBREQUIRED_USE\fR variable can be
634 used to specify combinations of \fBUSE\fR flags that are allowed
635 or not allowed. Elements can be nested when necessary.
636 .TS
637 l l
638 __
639 l l.
640 Behavior        Expression
641 If flag1 enabled then flag2 disabled    flag1? ( !flag2 )
642 If flag1 enabled then flag2 enabled     flag1? ( flag2 )
643 If flag1 disabled then flag2 enabled    !flag1? ( flag2 )
644 If flag1 disabled then flag2 disabled   !flag1? ( !flag2 )
645 Must enable any one or more (inclusive or)      || ( flag1 flag2 flag3 )
646 Must enable exactly one but not more (exclusive or)     ^^ ( flag1 flag2 flag3 )
647 May enable at most one (EAPI 5 or later)        ?? ( flag1 flag2 flag3 )
648 .TE
649 .TP
650 .B RESTRICT\fR = \fI[strip,mirror,fetch,userpriv]
651 This should be a space delimited list of portage features to restrict.
652 You may use conditional syntax to vary restrictions as seen above in DEPEND.
653 .PD 0
654 .RS
655 .TP
656 .I binchecks
657 Disable all QA checks for binaries.  This should ONLY be used in packages
658 for which binary checks make no sense (linux\-headers and kernel\-sources, for
659 example, can safely be skipped since they have no binaries).  If the binary
660 checks need to be skipped for other reasons (such as proprietary binaries),
661 see the \fBQA CONTROL VARIABLES\fR section for more specific exemptions.
662 .TP
663 .I bindist
664 Distribution of built packages is restricted.
665 .TP
666 .I fetch
667 like \fImirror\fR but the files will not be fetched via \fBSRC_URI\fR either.
668 .TP
669 .I installsources
670 Disables installsources for specific packages. This is for packages with
671 binaries that are not compatible with debugedit.
672 .TP
673 .I mirror
674 files in \fBSRC_URI\fR will not be downloaded from the \fBGENTOO_MIRRORS\fR.
675 .TP
676 .I primaryuri
677 fetch from URIs in \fBSRC_URI\fR before \fBGENTOO_MIRRORS\fR.
678 .TP
679 .I strip
680 final binaries/libraries will not be stripped of debug symbols.
681 .TP
682 .I test
683 do not run src_test even if user has \fBFEATURES\fR=test.
684 .TP
685 .I userpriv
686 Disables userpriv for specific packages.
687 .RE
688 .PD 1
689 .TP
690 .B PROPERTIES\fR = \fI[interactive]
691 A space delimited list of properties, with conditional syntax support.
692 .PD 0
693 .RS
694 .TP
695 .I interactive
696 One or more ebuild phases will produce a prompt that requires user interaction.
697 .RE
698 .PD 1
699 .TP
700 .B PROVIDE\fR = \fI"virtual/TARGET"
701 This variable should only be used when a package provides a virtual target.
702 For example, blackdown\-jdk and sun\-jdk provide \fIvirtual/jdk\fR.  This
703 allows for packages to depend on \fIvirtual/jdk\fR rather than on blackdown
704 or sun specifically.
705 .TP
706 .B DOCS
707 Beginning with \fBEAPI 4\fR, an array or space\-delimited list of documentation
708 files for the default src_install function to install using dodoc. If
709 undefined, a reasonable default list is used. See the documentation for
710 src_install below.
711
712 .SS "QA Control Variables:"
713 .TP
714 .B Usage Notes
715 Several QA variables are provided which allow an ebuild to manipulate some
716 of the QA checks performed by portage.  Use of these variables in ebuilds
717 should be kept to an absolute minimum otherwise they defeat the purpose
718 of the QA checks, and their use is subject to agreement of the QA team.
719 They are primarily intended for use by ebuilds that install closed\-source
720 binary objects that cannot be altered.
721
722 Note that objects that violate these rules may fail on some architectures.
723 .TP
724 .B QA_PREBUILT
725 This should contain a list of file paths, relative to the image
726 directory, of files that are pre\-built binaries. Paths
727 listed here will be appended to each of the QA_* variables
728 listed below. The paths may contain fnmatch\-like patterns
729 which will be internally translated to regular expressions for
730 the QA_* variables that support regular expressions instead
731 of fnmatch patterns. The translation mechanism simply replaces
732 "*" with ".*".
733 .TP
734 .B QA_TEXTRELS
735 This variable can be set to a list of file paths, relative to the image
736 directory, of files that contain text relocations that cannot be eliminated.
737 The paths may contain fnmatch patterns.
738
739 This variable is intended to be used on closed\-source binary objects that
740 cannot be altered.
741 .TP
742 .B QA_EXECSTACK
743 This should contain a list of file paths, relative to the image directory, of
744 objects that require executable stack in order to run.
745 The paths may contain fnmatch patterns.
746
747 This variable is intended to be used on objects that truly need executable
748 stack (i.e. not those marked to need it which in fact do not).
749 .TP
750 .B QA_WX_LOAD
751 This should contain a list of file paths, relative to the image directory, of
752 files that contain writable and executable segments.  These are rare.
753 The paths may contain fnmatch patterns.
754 .TP
755 .B QA_FLAGS_IGNORED
756 This should contain a list of file paths, relative to the image directory, of
757 files that do not contain .GCC.command.line sections or contain .hash sections.
758 The paths may contain regular expressions with escape\-quoted special characters.
759
760 This variable is intended to be used on files of binary packages which ignore
761 CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, and LDFLAGS variables.
762 .TP
763 .B QA_MULTILIB_PATHS
764 This should contain a list of file paths, relative to the image directory, of
765 files that should be ignored for the multilib\-strict checks.
766 The paths may contain regular expressions with escape\-quoted special characters.
767 .TP
768 .B QA_PRESTRIPPED
769 This should contain a list of file paths, relative to the image directory, of
770 files that contain pre-stripped binaries. The paths may contain regular
771 expressions with escape\-quoted special characters.
772 .TP
773 .B QA_SONAME
774 This should contain a list of file paths, relative to the image directory, of
775 shared libraries that lack SONAMEs. The paths may contain regular expressions
776 with escape\-quoted special characters.
777 .TP
778 .B QA_SONAME_NO_SYMLINK
779 This should contain a list of file paths, relative to the image directory, of
780 shared libraries that have SONAMEs but should not have a corresponding SONAME
781 symlink in the same directory. The paths may contain regular expressions
782 with escape\-quoted special characters.
783 .TP
784 .B QA_AM_MAINTAINER_MODE
785 This should contain a list of lines containing automake missing \-\-run
786 commands. The lines may contain regular expressions with escape\-quoted
787 special characters.
788 .TP
789 .B QA_CONFIGURE_OPTIONS
790 This should contain a list of configure options which trigger warnings about
791 unrecognized options. The options may contain regular expressions with
792 escape\-quoted special characters.
793 .TP
794 .B QA_DT_NEEDED
795 This should contain a list of file paths, relative to the image directory, of
796 shared libraries that lack NEEDED entries. The paths may contain regular
797 expressions with escape\-quoted special characters.
798 .TP
799 .B QA_DESKTOP_FILE
800 This should contain a list of file paths, relative to the image directory, of
801 desktop files which should not be validated. The paths may contain regular
802 expressions with escape\-quoted special characters.
803
804 .SH "PORTAGE DECLARATIONS"
805 .TP
806 .B inherit
807 Inherit is portage's maintenance of extra classes of functions that are
808 external to ebuilds and provided as inheritable capabilities and data. They
809 define functions and set data types as drop\-in replacements, expanded, and
810 simplified routines for extremely common tasks to streamline the build
811 process. Call to inherit cannot depend on conditions which can vary in given
812 ebuild. Specification of the eclasses contains only their name and not the
813 \fI.eclass\fR extension. Also note that the inherit statement must come
814 before other variable declarations unless these variables are used in global
815 scope of eclasses.
816
817 .SH "PHASE FUNCTIONS"
818 .TP
819 .B pkg_pretend
820 Beginning with \fBEAPI 4\fR, this function can be defined in order to
821 check that miscellaneous requirements are met. It is called as early
822 as possible, before any attempt is made to satisfy dependencies. If the
823 function detects a problem then it should call eerror and die. The
824 environment (variables, functions, temporary directories, etc..) that
825 is used to execute pkg_pretend is not saved and therefore is not
826 available in phases that execute afterwards.
827 .TP
828 .B pkg_nofetch
829 This function will be executed when the files in \fBSRC_URI\fR
830 cannot be fetched for any reason. If you turn on \fIfetch\fR in
831 \fBRESTRICT\fR, this is useful for displaying information to the
832 user on *how* to obtain said files. All
833 you have to do is output a message and let the function return.  Do not
834 end the function with a call to \fBdie\fR.
835 .TP
836 .B pkg_setup
837 This function can be used if the package needs specific setup actions or
838 checks to be preformed before anything else.
839 .br
840 Initial working directory: $PORTAGE_TMPDIR
841 .TP
842 .B src_unpack
843 This function is used to unpack all the sources in \fIA\fR to \fIWORKDIR\fR.
844 If not defined in the \fIebuild script\fR it calls \fIunpack ${A}\fR. Any
845 patches and other pre configure/compile modifications should be done here.
846 .br
847 Initial working directory: $WORKDIR
848 .TP
849 .B src_prepare
850 All preparation of source code, such as application of patches, should be done
851 here. This function is supported beginning with \fBEAPI 2\fR.
852 .br
853 Initial working directory: $S
854 .TP
855 .B src_configure
856 All necessary steps for configuration should be done here. This function is
857 supported beginning with \fBEAPI 2\fR.
858 .br
859 Initial working directory: $S
860 .TP
861 .B src_compile
862 With less than \fBEAPI 2\fR, all necessary steps for both configuration and
863 compilation should be done here. Beginning with \fBEAPI 2\fR, only compilation
864 steps should be done here.
865 .br
866 Initial working directory: $S
867 .TP
868 .B src_test
869 Run all package specific test cases. The default is to run
870 \'emake check\' followed \'emake test\'. Prior to \fBEAPI 5\fR,
871 the default src_test implementation will automatically pass the
872 \-j1 option as the last argument to emake, and beginning with
873 \fBEAPI 5\fR it will allow the tests to run in parallel.
874 .br
875 Initial working directory: $S
876 .TP
877 .B src_install
878 Should contain everything required to install the package in the temporary
879 \fIinstall directory\fR.
880 .br
881 Initial working directory: $S
882
883 Beginning with \fBEAPI 4\fR, if src_install is undefined then the
884 following default implementation is used:
885
886 .nf
887 src_install() {
888     if [[ \-f Makefile || \-f GNUmakefile || \-f makefile ]] ; then
889         emake DESTDIR="${D}" install
890     fi
891
892     if ! declare -p DOCS &>/dev/null ; then
893         local d
894         for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \\
895                 THANKS BUGS FAQ CREDITS CHANGELOG ; do
896             [[ \-s "${d}" ]] && dodoc "${d}"
897         done
898     elif [[ $(declare \-p DOCS) == "declare \-a "* ]] ; then
899         dodoc "${DOCS[@]}"
900     else
901         dodoc ${DOCS}
902     fi
903 }
904 .fi
905 .TP
906 .B pkg_preinst pkg_postinst
907 All modifications required on the live\-filesystem before and after the
908 package is merged should be placed here. Also commentary for the user
909 should be listed here as it will be displayed last.
910 .br
911 Initial working directory: $PWD
912 .TP
913 .B pkg_prerm pkg_postrm
914 Like the pkg_*inst functions but for unmerge.
915 .br
916 Initial working directory: $PWD
917 .TP
918 .B pkg_config
919 This function should contain optional basic configuration steps.
920 .br
921 Initial working directory: $PWD
922
923 .SH "HELPER FUNCTIONS"
924 .SS "Phases:"
925 .TP
926 .B default
927 Calls the default phase function implementation for the currently executing
928 phase. This function is supported beginning with \fBEAPI 2\fR.
929 .TP
930 .B default_*
931 Beginning with \fBEAPI 2\fR, the default pkg_nofetch and src_* phase
932 functions are accessible via a function having a name that begins with
933 default_ and ends with the respective phase function name. For example,
934 a call to a function with the name default_src_compile is equivalent to
935 a call to the default src_compile implementation.
936
937 .RS
938 .TS
939 l
940 _
941 l.
942 Default Phase Functions
943 default_pkg_nofetch
944 default_src_unpack
945 default_src_prepare
946 default_src_configure
947 default_src_compile
948 default_src_test
949 .TE
950 .RE
951
952 .SS "General:"
953 .TP
954 .B die\fR \fI[reason]
955 Causes the current emerge process to be aborted. The final display will
956 include \fIreason\fR.
957
958 Beginning with \fBEAPI 4\fR, all helpers automatically call \fBdie\fR
959 whenever some sort of error occurs. Helper calls may be prefixed with
960 the \fBnonfatal\fR helper in order to prevent errors from being fatal.
961 .TP
962 .B nonfatal\fR \fI<helper>
963 Execute \fIhelper\fR and \fIdo not\fR call die if it fails.
964 The \fBnonfatal\fR helper is available beginning with \fBEAPI 4\fR.
965 .TP
966 .B use\fR \fI<USE item>
967 If \fIUSE item\fR is in the \fBUSE\fR variable, the function will silently
968 return 0 (aka shell true).  If \fIUSE item\fR is not in the \fBUSE\fR
969 variable, the function will silently return 1 (aka shell false).  \fBusev\fR
970 is a verbose version of \fBuse\fR.
971 .RS
972 .TP
973 .I Example:
974 .nf
975 if use gnome ; then
976         guiconf="\-\-enable\-gui=gnome \-\-with\-x"
977 elif use gtk ; then
978         guiconf="\-\-enable\-gui=gtk \-\-with\-x"
979 elif use X ; then
980         guiconf="\-\-enable\-gui=athena \-\-with\-x"
981 else
982         # No gui version will be built
983         guiconf=""
984 fi
985 .fi
986 .RE
987 .TP
988 .B usex\fR \fI<USE flag>\fR \fI[true output]\fR \fI[false output]\fR \fI[true suffix]\fR \fI[false suffix]
989 If USE flag is set, echo [true output][true suffix] (defaults to
990 "yes"), otherwise echo [false output][false suffix] (defaults to
991 "no"). The usex helper is available beginning with \fBEAPI 5\fR.
992 .TP
993 .B use_with\fR \fI<USE item>\fR \fI[configure name]\fR \fI[configure opt]
994 Useful for creating custom options to pass to a configure script. If \fIUSE
995 item\fR is in the \fBUSE\fR variable and a \fIconfigure opt\fR is specified,
996 then the string \fI\-\-with\-[configure name]=[configure opt]\fR will be echoed.
997 If \fIconfigure opt\fR is not specified, then just \fI\-\-with\-[configure
998 name]\fR will be echoed.  If \fIUSE item\fR is not in the \fBUSE\fR variable,
999 then the string \fI\-\-without\-[configure name]\fR will be echoed. If
1000 \fIconfigure name\fR is not specified, then \fIUSE item\fR will be used in
1001 its place. Beginning with \fBEAPI 4\fR, an empty \fIconfigure opt\fR argument
1002 is recognized. In \fBEAPI 3\fR and earlier, an empty \fIconfigure opt\fR
1003 argument is treated as if it weren't provided.
1004 .RS
1005 .TP
1006 .I Examples:
1007 .nf
1008 USE="opengl"
1009 myconf=$(use_with opengl)
1010 (myconf now has the value "\-\-with\-opengl")
1011
1012 USE="jpeg"
1013 myconf=$(use_with jpeg libjpeg)
1014 (myconf now has the value "\-\-with\-libjpeg")
1015
1016 USE=""
1017 myconf=$(use_with jpeg libjpeg)
1018 (myconf now has the value "\-\-without\-libjpeg")
1019
1020 USE="sdl"
1021 myconf=$(use_with sdl SDL all\-plugins)
1022 (myconf now has the value "\-\-with\-SDL=all\-plugins")
1023 .fi
1024 .RE
1025 .TP
1026 .B use_enable\fR \fI<USE item>\fR \fI[configure name]\fR \fI[configure opt]
1027 Same as \fBuse_with\fR above, except that the configure options are
1028 \fI\-\-enable\-\fR instead of \fI\-\-with\-\fR and \fI\-\-disable\-\fR instead of
1029 \fI\-\-without\-\fR. Beginning with \fBEAPI 4\fR, an empty \fIconfigure opt\fR
1030 argument is recognized. In \fBEAPI 3\fR and earlier, an empty
1031 \fIconfigure opt\fR argument is treated as if it weren't provided.
1032 .TP
1033 .B hasv\fR \fI<item>\fR \fI<item list>
1034 If \fIitem\fR is in \fIitem list\fR, then \fIitem\fR is echoed and \fBhasv\fR
1035 returns 0.  Otherwise, nothing is echoed and 1 is returned. As indicated with
1036 use, there is a non\-echoing version \fBhas\fR. Please use \fBhas\fR in all
1037 places where output is to be disregarded. Never use the output for calculation.
1038 .br
1039 The \fIitem list\fR is delimited by the \fIIFS\fR variable.  This variable
1040 has a default value of ' ', or a space.  It is a \fBbash\fR(1) setting.
1041 .TP
1042 .B has_version\fR \fI[\-\-host\-root]\fR \fI<category/package\-version>
1043 Check to see if \fIcategory/package\-version\fR is installed on the system.
1044 The parameter accepts all values that are acceptable in the \fBDEPEND\fR
1045 variable.  The function returns 0 if \fIcategory/package\-version\fR is
1046 installed, 1 otherwise. Beginning with \fBEAPI 5\fR, the
1047 \-\-host\-root option may be used in order to cause the query
1048 to apply to the host root instead of ${ROOT}.
1049 .TP
1050 .B best_version\fR \fI[\-\-host\-root]\fR \fI<package name>
1051 This function will look up \fIpackage name\fR in the database of currently
1052 installed programs and echo the "best version" of the package that is
1053 currently installed. Beginning with \fBEAPI 5\fR, the
1054 \-\-host\-root option may be used in order to cause the query
1055 to apply to the host root instead of ${ROOT}.
1056
1057 Example:
1058 .nf
1059         VERINS="$(best_version net\-ftp/glftpd)"
1060         (VERINS now has the value "net\-ftp/glftpd\-1.27" if glftpd\-1.27 is installed)
1061 .fi
1062
1063 .SS "Hooks:"
1064 .TP
1065 .B register_die_hook\fR \fI[list of function names]
1066 Register one or more functions to call when the ebuild fails for any reason,
1067 including file collisions with other packages.
1068 .TP
1069 .B register_success_hook\fR \fI[list of function names]
1070 Register one or more functions to call when the ebuild builds and/or installs
1071 successfully.
1072
1073 .SS "Output:"
1074 .TP
1075 .B einfo\fR \fI"disposable message"
1076 Same as \fBelog\fR, but should be used when the message isn't important to the
1077 user (like progress or status messages during the build process).
1078 .TP
1079 .B elog\fR \fI"informative message"
1080 If you need to display a message that you wish the user to read and take
1081 notice of, then use \fBelog\fR.  It works just like \fBecho\fR(1), but
1082 adds a little more to the output so as to catch the user's eye. The message
1083 will also be logged by portage for later review.
1084 .TP
1085 .B ewarn\fR \fI"warning message"
1086 Same as \fBeinfo\fR, but should be used when showing a warning to the user.
1087 .TP
1088 .B eqawarn\fR \fI"QA warning message"
1089 Same as \fBeinfo\fR, but should be used when showing a QA warning to the user.
1090 .TP
1091 .B eerror\fR \fI"error message"
1092 Same as \fBeinfo\fR, but should be used when showing an error to the user.
1093 .TP
1094 .B ebegin\fR \fI"helpful message"
1095 Like \fBeinfo\fR, we output a \fIhelpful message\fR and then hint that the
1096 following operation may take some time to complete.  Once the task is
1097 finished, you need to call \fBeend\fR.
1098 .TP
1099 .B eend\fR \fI<status>\fR \fI["error message"]
1100 Followup the \fBebegin\fR message with an appropriate "OK" or "!!" (for
1101 errors) marker.  If \fIstatus\fR is non\-zero, then the additional \fIerror
1102 message\fR is displayed.
1103
1104 .SS "Unpack:"
1105 .TP
1106 .B unpack\fR \fI<source>\fR \fI[list of more sources]
1107 This function uncompresses and/or untars a list of sources into the current
1108 directory. The function will append \fIsource\fR to the \fBDISTDIR\fR variable.
1109
1110 .SS "Compile:"
1111 .TP
1112 .B econf\fR \fI[configure options]
1113 This is used as a replacement for configure.  Performs:
1114 .nf
1115 ${\fIECONF_SOURCE\fR:-.}/configure \\
1116         ${CBUILD:+\-\-build=${CBUILD}} \\
1117         \-\-datadir="${EPREFIX}"/usr/share \\
1118         \-\-host=${CHOST} \\
1119         \-\-infodir="${EPREFIX}"/usr/share/info \\
1120         \-\-localstatedir="${EPREFIX}"/var/lib \\
1121         \-\-prefix="${EPREFIX}"/usr \\
1122         \-\-mandir="${EPREFIX}"/usr/share/man \\
1123         \-\-sysconfdir="${EPREFIX}"/etc \\
1124         ${CTARGET:+\-\-target=${CTARGET}} \\
1125         \-\-disable\-dependency\-tracking \\
1126         \fI${EXTRA_ECONF}\fR \\
1127         \fIconfigure options\fR || die "econf failed"
1128 .fi
1129 Note that the \fIEXTRA_ECONF\fR is for users only, not for ebuild
1130 writers.  If you wish to pass more options to configure, just pass the
1131 extra arguments to \fBeconf\fR. Also note that \fBeconf\fR automatically
1132 calls \fBdie\fR if the configure script fails.
1133 Beginning with \fBEAPI 3\fR, \fBeconf\fR uses the \fB${EPREFIX}\fR
1134 variable which is disregarded for prior \fBEAPI\fR values.
1135 Beginning with \fBEAPI 4\fR, \fBeconf\fR adds
1136 \fI\-\-disable\-dependency\-tracking\fR to the arguments if the
1137 string \fIdisable\-dependency\-tracking\fR occurs in the output
1138 of \fIconfigure \-\-help\fR.
1139 Beginning with \fBEAPI 5\fR, \fBeconf\fR adds
1140 \fIdisable\-silent\-rules\fR to the arguments if the
1141 string \fIdisable\-silent\-rules\fR occurs in the output
1142 of \fIconfigure \-\-help\fR.
1143 .TP
1144 .B emake\fR \fI[make options]
1145 This is used as a replacement for make.  Performs 'make ${MAKEOPTS}
1146 \fImake options\fR' (as set in make.globals), default is MAKEOPTS="\-j2".
1147
1148 .B ***WARNING***
1149 .br
1150 if you are going to use \fBemake\fR, make sure your build is happy with
1151 parallel makes (make \-j2).  It should be tested thoroughly as parallel
1152 makes are notorious for failing _sometimes_ but not always.  If you determine
1153 that your package fails to build in parallel, and you are unable to resolve
1154 the issue, then you should run '\fBemake\fR \-j1' instead of 'make'.
1155
1156 .SS "Install:"
1157 .TP
1158 .B einstall\fR \fI[make options]
1159 This is used as a replacement for make install.  Performs:
1160 .nf
1161 make \\
1162         prefix=${ED}/usr \\
1163         datadir=${ED}/usr/share \\
1164         infodir=${ED}/usr/share/info \\
1165         localstatedir=${ED}/var/lib \\
1166         mandir=${ED}/usr/share/man \\
1167         sysconfdir=${ED}/etc \\
1168         \fI${EXTRA_EINSTALL}\fR \\
1169         \fImake options\fR \\
1170         install
1171 .fi
1172 Please do \fBnot\fR use this in place of 'emake install DESTDIR=${D}'.
1173 That is the preferred way of installing make\-based packages.  Also, do
1174 not utilize the \fIEXTRA_EINSTALL\fR variable since it is for users.
1175
1176 .PD 0
1177 .TP
1178 .B prepall
1179 .TP
1180 .B prepalldocs
1181 .TP
1182 .B prepallinfo
1183 .TP
1184 .B prepallman
1185 .TP
1186 .B prepallstrip
1187 .PD 1
1188 Useful for when a package installs into \fB${D}\fR via scripts
1189 (i.e. makefiles).  If you want to be sure that libraries are executable,
1190 aclocal files are installed into the right place, doc/info/man files are
1191 all compressed, and that executables are all stripped of debugging symbols,
1192 then use these suite of functions.
1193 .RS
1194 .PD 0
1195 .TP
1196 .B prepall:
1197 Runs \fBprepallman\fR, \fBprepallinfo\fR, \fBprepallstrip\fR, sets
1198 libraries +x, and then checks aclocal directories.  Please note this
1199 does \fI*not*\fR run \fBprepalldocs\fR.
1200 .TP
1201 .B prepalldocs:
1202 Compresses all doc files in ${ED}/usr/share/doc.
1203 .TP
1204 .B prepallinfo:
1205 Compresses all info files in ${ED}/usr/share/info.
1206 .TP
1207 .B prepallman:
1208 Compresses all man files in ${ED}/usr/share/man.
1209 .TP
1210 .B prepallstrip:
1211 Strips all executable files of debugging symboles.  This includes libraries.
1212 .RE
1213
1214 .TP
1215 .B prepinfo\fR \fI[dir]
1216 .TP
1217 .B prepman\fR \fI[dir]
1218 .TP
1219 .B prepstrip\fR \fI[dir]
1220 .PD 1
1221 Similar to the \fBprepall\fR functions, these are subtle in their differences.
1222 .RS
1223 .PD 0
1224 .TP
1225 .B prepinfo:
1226 If a \fIdir\fR is not specified, then \fBprepinfo\fR will assume the dir
1227 \fIusr\fR. \fBprepinfo\fR will then compress all the files in
1228 ${ED}/\fIdir\fR/info.
1229 .TP
1230 .B prepman:
1231 If a \fIdir\fR is not specified, then \fBprepman\fR will assume the dir
1232 \fIusr\fR. \fBprepman\fR will then compress all the files in
1233 ${ED}/\fIdir\fR/man/*/.
1234 .TP
1235 .B prepstrip:
1236 All the files found in ${ED}/\fIdir\fR will be stripped.  You may specify
1237 multiple directories.
1238 .RE
1239 .PD 1
1240 .TP
1241 .B docompress\fR \fI[\-x] <path> [list of more paths]
1242 .RS
1243 Beginning with \fBEAPI 4\fR, the \fBdocompress\fR helper is used to
1244 manage lists of files to be included or excluded from optional compression.
1245 If the first argument is \fB\-x\fR, add each of its subsequent arguments to
1246 the exclusion list. Otherwise, add each argument to the inclusion list.
1247 The inclusion list initially contains \fI/usr/share/doc\fR,
1248 \fI/usr/share/info\fR, and \fI/usr/share/man\fR. The exclusion list
1249 initially contains \fI/usr/share/doc/${PF}/html\fR.
1250
1251 The optional compression shall be carried out after \fBsrc_install\fR
1252 has completed, and before the execution of any subsequent phase
1253 function. For each item in the inclusion list, pretend it has the
1254 value of the \fBD\fR variable prepended, then:
1255
1256 .RS
1257 If it is a directory, act as if every file or directory immediately
1258 under this directory were in the inclusion list.
1259
1260 If the item is a file, it may be compressed unless it has been
1261 excluded as described below.
1262
1263 If the item does not exist, it is ignored.
1264 .RE
1265
1266 Whether an item is to be excluded is determined as follows: For each
1267 item in the exclusion list, pretend it has the value of the \fBD\fR
1268 variable prepended, then:
1269
1270 .RS
1271 If it is a directory, act as if every file or directory immediately
1272 under this directory were in the exclusion list.
1273
1274 If the item is a file, it shall not be compressed.
1275
1276 If the item does not exist, it is ignored.
1277 .RE
1278 .RE
1279 .TP
1280 .B dosed\fR \fI"s:orig:change:g" <filename>
1281 Beginning with \fBEAPI 4\fR, the \fBdosed\fR helper no longer exists. Ebuilds
1282 should call \fBsed(1)\fR directly (and assume that it is GNU sed).
1283
1284 Performs sed in place on \fIfilename\fR inside ${ED}. If no expression is
1285 given then \fI"s:${D}::g"\fR is used as the default expression.  Note
1286 that this expression does \fBNOT\fR use the offset prefix.
1287 .br
1288 .BR 'dosed\ "s:/usr/local:/usr:g"\ /usr/bin/some\-script'
1289 runs sed on ${ED}/usr/bin/some\-script
1290 .TP
1291 .B dodir\fR \fI<path> [more paths]
1292 Creates directories inside of ${ED}.
1293 .br
1294 .BR 'dodir\ /usr/lib/apache'
1295 creates ${ED}/usr/lib/apache.  Note that the do* functions will run
1296 \fBdodir\fR for you.
1297 .TP
1298 .B diropts\fR \fI[options for install(1)]
1299 Can be used to define options for the install function used in
1300 \fBdodir\fR.  The default is \fI\-m0755\fR.
1301 .TP
1302 .B into\fR \fI<path>
1303 Sets the root (\fIDESTTREE\fR) for other functions like \fBdobin\fR,
1304 \fBdosbin\fR, \fBdoman\fR, \fBdoinfo\fR, \fBdolib\fR.
1305 .br
1306 The default root is /usr.
1307 .TP
1308 .B keepdir\fR \fI<path> [more paths]
1309 Tells portage to leave directories behind even if they're empty.  Functions
1310 the same as \fBdodir\fR.
1311 .TP
1312 .B dobin\fR \fI<binary> [list of more binaries]
1313 Installs a \fIbinary\fR or a list of binaries into \fIDESTTREE\fR/bin.
1314 Creates all necessary dirs.
1315 .TP
1316 .B dosbin\fR \fI<binary> [list of more binaries]
1317 Installs a \fIbinary\fR or a list of binaries into \fIDESTTREE\fR/sbin.
1318 Creates all necessary dirs.
1319 .TP
1320 .B doinitd\fR \fI<init.d script> [list of more init.d scripts]
1321 Install Gentoo \fIinit.d scripts\fR.  They will be installed into the
1322 correct location for Gentoo init.d scripts (/etc/init.d/).  Creates all
1323 necessary dirs.
1324 .TP
1325 .B doconfd\fR \fI<conf.d file> [list of more conf.d file]
1326 Install Gentoo \fIconf.d files\fR.  They will be installed into the
1327 correct location for Gentoo conf.d files (/etc/conf.d/).  Creates all
1328 necessary dirs.
1329 .TP
1330 .B doenvd\fR \fI<env.d entry> [list of more env.d entries]
1331 Install Gentoo \fIenv.d entries\fR.  They will be installed into the
1332 correct location for Gentoo env.d entries (/etc/env.d/).  Creates all
1333 necessary dirs.
1334
1335 .PD 0
1336 .TP
1337 .B dolib\fR \fI<library>\fR \fI[list of more libraries]
1338 .TP
1339 .B dolib.a\fR \fI<library>\fR \fI[list of more libraries]
1340 .TP
1341 .B dolib.so\fR \fI<library>\fR \fI[list of more libraries]
1342 .PD 1
1343 Installs a library or a list of libraries into \fIDESTTREE\fR/lib.
1344 Creates all necessary dirs.
1345 .TP
1346 .B libopts\fR \fI[options for install(1)]
1347 Can be used to define options for the install function used in
1348 the \fBdolib\fR functions.  The default is \fI\-m0644\fR.
1349 .TP
1350 .B doman\fR \fI[\-i18n=<locale>]\fR \fI<man\-page> [list of more man\-pages]
1351 Installs manual\-pages into /usr/share/man/man[0\-9n] depending on the
1352 manual file ending.  The files are compressed if they are not already.  You
1353 can specify locale\-specific manpages with the \fI\-i18n\fR option.  Then the
1354 man\-page will be installed into /usr/share/man/\fI<locale>\fR/man[0\-9n].
1355 Beginning with \fBEAPI 2\fR, a locale\-specific manpage which contains a locale
1356 in the file name will be installed in /usr/share/man/\fI<locale>\fR/man[0\-9n],
1357 with the locale portion of the file name removed, and the \fI\-i18n\fR option
1358 has no effect. For example, with \fBEAPI 2\fR, a manpage named
1359 foo.\fI<locale>\fR.1 will be installed as
1360 /usr/share/man/\fI<locale>\fR/man1/foo.1. Beginning with \fBEAPI 4\fR,
1361 the \fI\-i18n\fR option takes precedence over the locale suffix of the
1362 file name.
1363 .PD 0
1364 .TP
1365 .B dohard\fR \fI<filename> <linkname>
1366 Beginning with \fBEAPI 4\fR, the \fBdohard\fR helper no longer exists. Ebuilds
1367 should call \fBln(1)\fR directly.
1368 .TP
1369 .B dosym\fR \fI<filename> <linkname>
1370 .PD 1
1371 Performs the ln command to create a symlink.
1372 .TP
1373 .B doheader\fR \fI[\-r] <file> [list of more files]
1374 Installs the given header files into /usr/include/, by default
1375 with file mode \fI0644\fR (this can be overridden with the
1376 \fBinsopts\fR function). Setting \-r sets recursive. The
1377 \fBdoheader\fR helper is available beginning with \fBEAPI 5\fR.
1378 .TP
1379 .B dohtml\fR \fI [\-a filetypes] [\-r] [\-x list\-of\-dirs\-to\-ignore] [list\-of\-files\-and\-dirs]
1380 Installs the files in the list of files (space\-separated list) into
1381 /usr/share/doc/${PF}/html provided the file ends in .htm, .html, .css, .js, .gif, .jpeg, .jpg, or .png.
1382 Setting \fI\-a\fR limits what types of files will be included,
1383 \fI\-A\fR appends to the default list, setting \fI\-x\fR sets which dirs to
1384 exclude (CVS excluded by default), \fI\-p\fR sets a document prefix, \fI\-r\fR sets recursive.
1385 .TP
1386 .B doinfo\fR \fI<info\-file> [list of more info\-files]
1387 Installs info\-pages into \fIDESTDIR\fR/info.  Files are automatically
1388 gzipped.  Creates all necessary dirs.
1389 .TP
1390 .B domo\fR \fI<locale\-file> [list of more locale\-files]
1391 Installs locale\-files into \fIDESTDIR\fR/usr/share/locale/[LANG]
1392 depending on local\-file's ending.  Creates all necessary dirs.
1393
1394 .PD 0
1395 .TP
1396 .B fowners\fR \fI<permissions> <file> [files]
1397 .TP
1398 .B fperms\fR \fI<permissions> <file> [files]
1399 .PD 1
1400 Performs chown (\fBfowners\fR) or chmod (\fBfperms\fR), applying
1401 \fIpermissions\fR to \fIfiles\fR.
1402 .TP
1403 .B insinto\fR \fI[path]
1404 Sets the destination path for the \fBdoins\fR function.
1405 .br
1406 The default path is /.
1407 .TP
1408 .B insopts\fR \fI[options for install(1)]
1409 Can be used to define options for the install function used in
1410 \fBdoins\fR.  The default is \fI\-m0644\fR.
1411 .TP
1412 .B doins\fR \fI[\-r] <file> [list of more files]
1413 Installs files into the path controlled by \fBinsinto\fR.  This function
1414 uses \fBinstall\fR(1).  Creates all necessary dirs.
1415 Setting \-r sets recursive. Beginning with \fBEAPI 4\fR, both
1416 \fBdoins\fR and \fBnewins\fR preserve symlinks. In \fBEAPI 3\fR and
1417 earlier, symlinks are dereferenced rather than preserved.
1418 .TP
1419 .B exeinto\fR \fI[path]
1420 Sets the destination path for the \fBdoexe\fR function.
1421 .br
1422 The default path is /.
1423 .TP
1424 .B exeopts\fR \fI[options for install(1)]
1425 Can be used to define options for the install function used in \fBdoexe\fR.
1426 The default is \fI\-m0755\fR.
1427 .TP
1428 .B doexe\fR \fI<executable> [list of more executables]
1429 Installs executables into the path controlled by \fBexeinto\fR.  This function
1430 uses \fBinstall\fR(1).  Creates all necessary dirs.
1431 .TP
1432 .B docinto\fR \fI[path]
1433 Sets the subdir used by \fBdodoc\fR and \fBdohtml\fR
1434 when installing into the document tree
1435 (based in /usr/share/doc/${PF}/).  Default is no subdir, or just "".
1436 .TP
1437 .B dodoc\fR \fI[-r] <document> [list of more documents]
1438 Installs a document or a list of documents into /usr/share/doc/${PF}/\fI<docinto path>\fR.
1439 Documents are marked for compression.  Creates all necessary dirs.
1440 Beginning with \fBEAPI 4\fR, there is support for recursion, enabled by the
1441 new \fI\-r\fR option.
1442
1443 .PD 0
1444 .TP
1445 .B newbin\fR \fI<old file> <new filename>
1446 .TP
1447 .B newsbin\fR \fI<old file> <new filename>
1448 .TP
1449 .B newinitd\fR \fI<old file> <new filename>
1450 .TP
1451 .B newconfd\fR \fI<old file> <new filename>
1452 .TP
1453 .B newenvd\fR \fI<old file> <new filename>
1454 .TP
1455 .B newlib.so\fR \fI<old file> <new filename>
1456 .TP
1457 .B newlib.a\fR \fI<old file> <new filename>
1458 .TP
1459 .B newman\fR \fI<old file> <new filename>
1460 .TP
1461 .B newinfo\fR \fI<old file> <new filename>
1462 .TP
1463 .B newins\fR \fI<old file> <new filename>
1464 .TP
1465 .B newexe\fR \fI<old file> <new filename>
1466 .TP
1467 .B newdoc\fR \fI<old file> <new filename>
1468 .PD 1
1469 All these functions act like the do* functions, but they only work with one
1470 file and the file is installed as \fI[new filename]\fR.
1471 Beginning with \fBEAPI 5\fR, standard input is read when the
1472 first parameter is \- (a hyphen).
1473
1474 .SH "EXAMPLES"
1475 .DS
1476 .nf
1477 # Copyright 1999\-2009 Gentoo Foundation
1478 # Distributed under the terms of the GNU General Public License v2
1479 # $Header: $
1480
1481 EAPI="5"
1482
1483 inherit some_eclass another_eclass
1484
1485 DESCRIPTION="Super\-useful stream editor (sed)"
1486 HOMEPAGE="http://www.gnu.org/software/sed/sed.html"
1487 SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.gz"
1488
1489 LICENSE="GPL\-2"
1490 SLOT="0"
1491 KEYWORDS="~x86"
1492 IUSE=""
1493
1494 RDEPEND=""
1495 DEPEND="nls? ( sys-devel/gettext )"
1496
1497 src_configure() {
1498         econf \\
1499                 \-\-bindir="${EPREFIX}"/bin
1500 }
1501
1502 src_install() {
1503         emake DESTDIR="${D}" install
1504         dodoc NEWS README* THANKS AUTHORS BUGS ChangeLog
1505 }
1506 .fi
1507 .DE
1508
1509 .SH "FILES"
1510 .TP
1511 The \fI/usr/sbin/ebuild.sh\fR script.
1512 .TP
1513 The helper apps in \fI/usr/lib/portage/bin\fR.
1514 .TP
1515 .B /etc/portage/make.conf
1516 Contains variables for the build\-process and overwrites those in make.defaults.
1517 .TP
1518 .B /usr/share/portage/config/make.globals
1519 Contains the default variables for the build\-process, you should edit
1520 \fI/etc/portage/make.conf\fR instead.
1521 .TP
1522 .B /etc/portage/color.map
1523 Contains variables customizing colors.
1524
1525 .SH "SEE ALSO"
1526 .BR ebuild (1),
1527 .BR make.conf (5),
1528 .BR color.map (5)
1529
1530 .SH "REPORTING BUGS"
1531 Please report bugs via http://bugs.gentoo.org/
1532
1533 .SH "AUTHORS"
1534 .nf
1535 Achim Gottinger <achim@gentoo.org>
1536 Mark Guertin <gerk@gentoo.org>
1537 Nicholas Jones <carpaski@gentoo.org>
1538 Mike Frysinger <vapier@gentoo.org>
1539 Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@gmail.com>
1540 Fabian Groffen <grobian@gentoo.org>
1541 .fi