drop support for QA_DT_HASH/QA_STRICT_DT_HASH
[portage.git] / man / ebuild.5
1 .TH "EBUILD" "5" "Sep 2012" "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 .SH "VARIABLES"
320 .TP
321 .B Usage Notes
322 \- All variables defined in \fBmake.conf\fR(5) are available for use in
323 ebuilds (such as the PORTAGE* and PORTDIR* variables)
324 .br
325 \- When assigning values to variables in ebuilds, you \fIcannot have a
326 space\fR between the variable name and the equal sign.
327 .br
328 \- Variable values should only contain characters that are members of the
329 \fBascii\fR(7) character set. This requirement is mandated by \fBGLEP 31\fR.
330 .TP
331 .B P
332 This variable contains the package name without the ebuild revision.
333 This variable must NEVER be modified.
334
335 xfree\-4.2.1\-r2.ebuild \-\-> $P=='xfree\-4.2.1'
336 .TP
337 .B PN
338 Contains the name of the script without the version number.
339
340 xfree\-4.2.1\-r2.ebuild \-\-> $PN=='xfree'
341 .TP
342 .B PV
343 Contains the version number without the revision.
344
345 xfree\-4.2.1\-r2.ebuild \-\-> $PV=='4.2.1'
346 .TP
347 .B PR
348 Contains the revision number or 'r0' if no revision number exists.
349
350 xfree\-4.2.1\-r2.ebuild \-\-> $PR=='r2'
351 .TP
352 .B PVR
353 Contains the version number with the revision.
354
355 xfree\-4.2.1\-r2.ebuild \-\-> $PVR=='4.2.1\-r2'
356 .TP
357 .B PF
358 Contains the full package name \fBPN\fR\-\fBPVR\fR
359
360 xfree\-4.2.1\-r2.ebuild \-\-> $PF=='xfree\-4.2.1\-r2'
361 .TP
362 .B CATEGORY
363 Contains the package category name.
364 .TP
365 .B A
366 Contains all source files required for the package.  This variable must
367 not be defined. It is autogenerated from the \fBSRC_URI\fR variable.
368 .TP
369 .B WORKDIR\fR = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/work"
370 Contains the path to the package build root.  Do not modify this variable.
371 .TP
372 .B FILESDIR\fR = \fI"${PORTDIR}/${CATEGORY}/${PN}/files"
373 Contains the path to the 'files' sub folder in the package specific
374 location in the portage tree.  Do not modify this variable.
375 .TP
376 .B EBUILD_PHASE
377 Contains the abreviated name of the phase function that is
378 currently executing, such as "setup", "unpack", "compile", or
379 "preinst".
380 .TP
381 .B EBUILD_PHASE_FUNC
382 Beginning with \fBEAPI 5\fR, contains the full name of the phase
383 function that is currently executing, such as "pkg_setup",
384 "src_unpack", "src_compile", or "pkg_preinst".
385 .TP
386 .B EPREFIX
387 Beginning with \fBEAPI 3\fR, contains the offset
388 that this Portage was configured for during
389 installation.  The offset is sometimes necessary in an ebuild or eclass,
390 and is available in such cases as ${EPREFIX}.  EPREFIX does not contain
391 a trailing slash, therefore an absent offset is represented by the empty
392 string.  Do not modify this variable.
393 .TP
394 .B S\fR = \fI"${WORKDIR}/${P}"
395 Contains the path to the temporary \fIbuild directory\fR.  This variable
396 is used by the functions \fIsrc_compile\fR and \fIsrc_install\fR.  Both
397 are executed with \fIS\fR as the current directory.  This variable may
398 be modified to match the extraction directory of a tarball for the package.
399 .TP
400 .B T\fR = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/temp"
401 Contains the path to a \fItemporary directory\fR.  You may use this for
402 whatever you like.
403 .TP
404 .B D\fR = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/image/"
405 Contains the path to the temporary \fIinstall directory\fR.  Every write
406 operation that does not involve the helper tools and functions (found below)
407 should be prefixed with ${D}.
408 Beginning with \fBEAPI 3\fR, the offset prefix often needs
409 to be taken into account here, for which the variable
410 ${ED} is provided (see below).
411 Do not modify this variable.
412 .TP
413 .B ED\fR = \fI"${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/image/${EPREFIX}/"
414 Beginning with \fBEAPI 3\fR, contains the path
415 "${D%/}${EPREFIX}/" for convenience purposes.
416 For EAPI values prior to \fBEAPI 3\fR which do
417 not support ED, helpers use \fBD\fR where
418 they would otherwise use ED.
419 Do not modify this variable.
420 .TP
421 .B MERGE_TYPE
422 Beginning with \fBEAPI 4\fR, the MERGE_TYPE variable can be used to
423 query the current merge type. This variable will contain one of the
424 following possible values:
425
426 .RS
427 .TS
428 l l
429 __
430 l l.
431 Value   Meaning
432 binary  previously\-built which is scheduled for merge
433 buildonly       source\-build which is not scheduled for merge
434 source  source\-build which is scheduled for merge
435 .TE
436 .RE
437 .TP
438 .B PORTAGE_LOG_FILE
439 Contains the path of the build log. If \fBPORT_LOGDIR\fR variable is unset then
440 PORTAGE_LOG_FILE=\fI"${T}/build.log"\fR.
441 .TP
442 .B REPLACED_BY_VERSION
443 Beginning with \fBEAPI 4\fR, the REPLACED_BY_VERSION variable can be
444 used in pkg_prerm and pkg_postrm to query the package version that
445 is replacing the current package. If there is no replacement package,
446 the variable will be empty, otherwise it will contain a single version
447 number.
448 .TP
449 .B REPLACING_VERSIONS
450 Beginning with \fBEAPI 4\fR, the REPLACING_VERSIONS variable can be
451 used in pkg_pretend, pkg_setup, pkg_preinst and pkg_postinst to query
452 the package version(s) that the current package is replacing. If there
453 are no packages to replace, the variable will be empty, otherwise it
454 will contain a space\-separated list of version numbers corresponding
455 to the package version(s) being replaced. Typically, this variable will
456 not contain more than one version, but according to PMS it can contain
457 more.
458 .TP
459 .B ROOT\fR = \fI"/"
460 Contains the path that portage should use as the root of the live filesystem.
461 When packages wish to make changes to the live filesystem, they should do so in
462 the tree prefixed by ${ROOT}.  Often the offset prefix needs to be taken
463 into account here, for which the variable ${EROOT} is provided (see
464 below).  Do not modify this variable.
465 .TP
466 .B EROOT\fR = \fI"${ROOT%/}${EPREFIX}/"
467 Beginning with \fBEAPI 3\fR, contains
468 "${ROOT%/}${EPREFIX}/" for convenience
469 purposes. Do not modify this variable.
470 .TP
471 .B DESCRIPTION\fR = \fI"A happy little package"
472 Should contain a short description of the package.
473 .TP
474 .B EAPI\fR = \fI"0"
475 Defines the ebuild API version to which this package conforms. If not
476 defined then it defaults to "0". If portage does not recognize the
477 EAPI value then it will mask the package and refuse to perform any
478 operations with it since this means that a newer version of portage
479 needs to be installed first. For maximum backward compatiblity, a
480 package should conform to the lowest possible EAPI. Note that anyone
481 who uses the \fBebuild\fR(1) and \fBrepoman\fR(1) commands with this
482 package will be required to have a version of portage that recognizes
483 the EAPI to which this package conforms.
484 .TP
485 .B SRC_URI\fR = \fI"http://example.com/path/${P}.tar.gz"
486 Contains a list of URIs for the required source files.  It can contain
487 multiple URIs for a single source file.  The list is processed in order
488 if the file was not found on any of the \fIGENTOO_MIRRORS\fR.
489 Beginning with \fBEAPI 2\fR, the output file name of a given URI may be
490 customized with a "->" operator on the right hand side, followed by the
491 desired output file name. All tokens, including the operator and output
492 file name, should be separated by whitespace.
493 .TP
494 .B HOMEPAGE\fR = \fI"http://example.com/"
495 Should contain a list of URIs for the sources main sites and other further
496 package dependent information.
497 .TP
498 .B KEYWORDS\fR = \fI[\-~][x86,ppc,sparc,mips,alpha,arm,hppa]
499 Should contain appropriate list of arches that the ebuild is know to
500 work/not work.  By default if you do not know if an ebuild runs under
501 a particular arch simply omit that KEYWORD.  If the ebuild will not
502 work on that arch include it as \-ppc for example.  If the ebuild is
503 being submitted for inclusion, it must have ~arch set for architectures
504 where it has been PROVEN TO WORK.  (Packages KEYWORDed this way may be
505 unmasked for testing by setting ACCEPT_KEYWORDS="~arch" on the command
506 line, or in \fBmake.conf\fR(5)) For an authoritative list please review
507 /usr/portage/profiles/arch.list.  Please keep this list in alphabetical order.
508 .TP
509 .B SLOT
510 This sets the SLOT for packages that may need to have multiple versions
511 co\-exist.  By default you should set \fBSLOT\fR="0".  If you are unsure, then
512 do not fiddle with this until you seek some guidance from some guru.  This
513 value should \fINEVER\fR be left undefined.
514
515 Beginning with \fBEAPI 5\fR, the SLOT variable may contain
516 an optional sub\-slot part that follows the regular slot and
517 is delimited by a / character. The sub\-slot must be a valid
518 slot name. The sub\-slot is used to represent cases in which
519 an upgrade to a new version of a package with a different
520 sub\-slot may require dependent packages to be rebuilt. When
521 the sub\-slot part is omitted from the SLOT definition, the
522 package is considered to have an implicit sub\-slot which is
523 equal to the regular slot. Refer to the \fBAtom Slot
524 Operators\fR section for more information about sub\-slot
525 usage.
526 .TP
527 .B LICENSE
528 This should be a space delimited list of licenses that the package falls
529 under.  This \fB_must_\fR be set to a matching license in
530 /usr/portage/licenses/. If the license does not exist in portage yet, you
531 must add it first.
532 .TP
533 .B IUSE
534 This should be a list of any and all USE flags that are leveraged within
535 your build script.  The only USE flags that should not be listed here are
536 arch related flags (see \fBKEYWORDS\fR). Beginning with \fBEAPI 1\fR, it
537 is possible to prefix flags with + or - in order to create default settings
538 that respectively enable or disable the corresponding \fBUSE\fR flags. For
539 details about \fBUSE\fR flag stacking order, refer to the \fBUSE_ORDER\fR
540 variable in \fBmake.conf\fR(5). Given the default \fBUSE_ORDER\fR setting,
541 negative IUSE default settings are effective only for negation of
542 repo\-level USE settings, since profile and user configuration settings
543 override them.
544 .TP
545 .B DEPEND
546 This should contain a list of all packages that are required for the program
547 to compile (aka \fIbuildtime\fR dependencies).  These are usually libraries and
548 headers.
549
550 You may use the syntax described above in the \fBDependencies\fR section.
551 .TP
552 .B RDEPEND
553 This should contain a list of all packages that are required for this
554 program to run (aka \fIruntime\fR dependencies).  These are usually libraries.
555
556 In \fBEAPI 3\fR or earlier, if this is not set, then it defaults to the value
557 of \fBDEPEND\fR. In \fBEAPI 4\fR or later, \fBRDEPEND\fR will never be
558 implicitly set.
559
560 You may use the syntax described above in the \fBDependencies\fR section.
561 .TP
562 .B PDEPEND
563 This should contain a list of all packages that should be merged after this
564 one (aka \fIpost\fR merge dependencies), but which may be installed by the
565 package manager at any time, if that is not possible.
566
567 .B ***WARNING***
568 .br
569 Use this only as last resort to break cyclic dependencies!
570
571 You may use the syntax described above in the \fBDependencies\fR section.
572 .TP
573 .B REQUIRED_USE
574 Beginning with \fBEAPI 4\fR, the \fBREQUIRED_USE\fR variable can be
575 used to specify combinations of \fBUSE\fR flags that are allowed
576 or not allowed. Elements can be nested when necessary.
577 .TS
578 l l
579 __
580 l l.
581 Behavior        Expression
582 If flag1 enabled then flag2 disabled    flag1? ( !flag2 )
583 If flag1 enabled then flag2 enabled     flag1? ( flag2 )
584 If flag1 disabled then flag2 enabled    !flag1? ( flag2 )
585 If flag1 disabled then flag2 disabled   !flag1? ( !flag2 )
586 Must enable any one or more (inclusive or)      || ( flag1 flag2 flag3 )
587 Must enable exactly one but not more (exclusive or)     ^^ ( flag1 flag2 flag3 )
588 May enable at most one (EAPI 5 or later)        ?? ( flag1 flag2 flag3 )
589 .TE
590 .TP
591 .B RESTRICT\fR = \fI[strip,mirror,fetch,userpriv]
592 This should be a space delimited list of portage features to restrict.
593 You may use conditional syntax to vary restrictions as seen above in DEPEND.
594 .PD 0
595 .RS
596 .TP
597 .I binchecks
598 Disable all QA checks for binaries.  This should ONLY be used in packages
599 for which binary checks make no sense (linux\-headers and kernel\-sources, for
600 example, can safely be skipped since they have no binaries).  If the binary
601 checks need to be skipped for other reasons (such as proprietary binaries),
602 see the \fBQA CONTROL VARIABLES\fR section for more specific exemptions.
603 .TP
604 .I bindist
605 Distribution of built packages is restricted.
606 .TP
607 .I fetch
608 like \fImirror\fR but the files will not be fetched via \fBSRC_URI\fR either.
609 .TP
610 .I installsources
611 Disables installsources for specific packages. This is for packages with
612 binaries that are not compatible with debugedit.
613 .TP
614 .I mirror
615 files in \fBSRC_URI\fR will not be downloaded from the \fBGENTOO_MIRRORS\fR.
616 .TP
617 .I primaryuri
618 fetch from URIs in \fBSRC_URI\fR before \fBGENTOO_MIRRORS\fR.
619 .TP
620 .I strip
621 final binaries/libraries will not be stripped of debug symbols.
622 .TP
623 .I test
624 do not run src_test even if user has \fBFEATURES\fR=test.
625 .TP
626 .I userpriv
627 Disables userpriv for specific packages.
628 .RE
629 .PD 1
630 .TP
631 .B PROPERTIES\fR = \fI[interactive]
632 A space delimited list of properties, with conditional syntax support.
633 .PD 0
634 .RS
635 .TP
636 .I interactive
637 One or more ebuild phases will produce a prompt that requires user interaction.
638 .RE
639 .PD 1
640 .TP
641 .B PROVIDE\fR = \fI"virtual/TARGET"
642 This variable should only be used when a package provides a virtual target.
643 For example, blackdown\-jdk and sun\-jdk provide \fIvirtual/jdk\fR.  This
644 allows for packages to depend on \fIvirtual/jdk\fR rather than on blackdown
645 or sun specifically.
646 .TP
647 .B DOCS
648 Beginning with \fBEAPI 4\fR, an array or space\-delimited list of documentation
649 files for the default src_install function to install using dodoc. If
650 undefined, a reasonable default list is used. See the documentation for
651 src_install below.
652
653 .SS "QA Control Variables:"
654 .TP
655 .B Usage Notes
656 Several QA variables are provided which allow an ebuild to manipulate some
657 of the QA checks performed by portage.  Use of these variables in ebuilds
658 should be kept to an absolute minimum otherwise they defeat the purpose
659 of the QA checks, and their use is subject to agreement of the QA team.
660 They are primarily intended for use by ebuilds that install closed\-source
661 binary objects that cannot be altered.
662
663 Note that objects that violate these rules may fail on some architectures.
664 .TP
665 .B QA_PREBUILT
666 This should contain a list of file paths, relative to the image
667 directory, of files that are pre\-built binaries. Paths
668 listed here will be appended to each of the QA_* variables
669 listed below. The paths may contain fnmatch\-like patterns
670 which will be internally translated to regular expressions for
671 the QA_* variables that support regular expressions instead
672 of fnmatch patterns. The translation mechanism simply replaces
673 "*" with ".*".
674 .TP
675 .B QA_TEXTRELS
676 This variable can be set to a list of file paths, relative to the image
677 directory, of files that contain text relocations that cannot be eliminated.
678 The paths may contain fnmatch patterns.
679
680 This variable is intended to be used on closed\-source binary objects that
681 cannot be altered.
682 .TP
683 .B QA_EXECSTACK
684 This should contain a list of file paths, relative to the image directory, of
685 objects that require executable stack in order to run.
686 The paths may contain fnmatch patterns.
687
688 This variable is intended to be used on objects that truly need executable
689 stack (i.e. not those marked to need it which in fact do not).
690 .TP
691 .B QA_WX_LOAD
692 This should contain a list of file paths, relative to the image directory, of
693 files that contain writable and executable segments.  These are rare.
694 The paths may contain fnmatch patterns.
695 .TP
696 .B QA_FLAGS_IGNORED
697 This should contain a list of file paths, relative to the image directory, of
698 files that do not contain .GCC.command.line sections or contain .hash sections.
699 The paths may contain regular expressions with escape\-quoted special characters.
700
701 This variable is intended to be used on files of binary packages which ignore
702 CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, and LDFLAGS variables.
703 .TP
704 .B QA_PRESTRIPPED
705 This should contain a list of file paths, relative to the image directory, of
706 files that contain pre-stripped binaries. The paths may contain regular
707 expressions with escape\-quoted special characters.
708 .TP
709 .B QA_SONAME
710 This should contain a list of file paths, relative to the image directory, of
711 shared libraries that lack SONAMEs. The paths may contain regular expressions
712 with escape\-quoted special characters.
713 .TP
714 .B QA_SONAME_NO_SYMLINK
715 This should contain a list of file paths, relative to the image directory, of
716 shared libraries that have SONAMEs but should not have a corresponding SONAME
717 symlink in the same directory. The paths may contain regular expressions
718 with escape\-quoted special characters.
719 .TP
720 .B QA_DT_NEEDED
721 This should contain a list of file paths, relative to the image directory, of
722 shared libraries that lack NEEDED entries. The paths may contain regular
723 expressions with escape\-quoted special characters.
724 .TP
725 .B QA_DESKTOP_FILE
726 This should contain a list of file paths, relative to the image directory, of
727 desktop files which should not be validated. The paths may contain regular
728 expressions with escape\-quoted special characters.
729
730 .SH "PORTAGE DECLARATIONS"
731 .TP
732 .B inherit
733 Inherit is portage's maintenance of extra classes of functions that are
734 external to ebuilds and provided as inheritable capabilities and data. They
735 define functions and set data types as drop\-in replacements, expanded, and
736 simplified routines for extremely common tasks to streamline the build
737 process. Call to inherit cannot depend on conditions which can vary in given
738 ebuild. Specification of the eclasses contains only their name and not the
739 \fI.eclass\fR extension. Also note that the inherit statement must come
740 before other variable declarations unless these variables are used in global
741 scope of eclasses.
742
743 .SH "PHASE FUNCTIONS"
744 .TP
745 .B pkg_pretend
746 Beginning with \fBEAPI 4\fR, this function can be defined in order to
747 check that miscellaneous requirements are met. It is called as early
748 as possible, before any attempt is made to satisfy dependencies. If the
749 function detects a problem then it should call eerror and die. The
750 environment (variables, functions, temporary directories, etc..) that
751 is used to execute pkg_pretend is not saved and therefore is not
752 available in phases that execute afterwards.
753 .TP
754 .B pkg_nofetch
755 This function will be executed when the files in \fBSRC_URI\fR
756 cannot be fetched for any reason. If you turn on \fIfetch\fR in
757 \fBRESTRICT\fR, this is useful for displaying information to the
758 user on *how* to obtain said files. All
759 you have to do is output a message and let the function return.  Do not
760 end the function with a call to \fBdie\fR.
761 .TP
762 .B pkg_setup
763 This function can be used if the package needs specific setup actions or
764 checks to be preformed before anything else.
765 .br
766 Initial working directory: $PORTAGE_TMPDIR
767 .TP
768 .B src_unpack
769 This function is used to unpack all the sources in \fIA\fR to \fIWORKDIR\fR.
770 If not defined in the \fIebuild script\fR it calls \fIunpack ${A}\fR. Any
771 patches and other pre configure/compile modifications should be done here.
772 .br
773 Initial working directory: $WORKDIR
774 .TP
775 .B src_prepare
776 All preparation of source code, such as application of patches, should be done
777 here. This function is supported beginning with \fBEAPI 2\fR.
778 .br
779 Initial working directory: $S
780 .TP
781 .B src_configure
782 All necessary steps for configuration should be done here. This function is
783 supported beginning with \fBEAPI 2\fR.
784 .br
785 Initial working directory: $S
786 .TP
787 .B src_compile
788 With less than \fBEAPI 2\fR, all necessary steps for both configuration and
789 compilation should be done here. Beginning with \fBEAPI 2\fR, only compilation
790 steps should be done here.
791 .br
792 Initial working directory: $S
793 .TP
794 .B src_test
795 Run all package specific test cases. The default is to run
796 \'emake check\' followed \'emake test\'. Prior to \fBEAPI 5\fR,
797 the default src_test implementation will automatically pass the
798 \-j1 option as the last argument to emake, and beginning with
799 \fBEAPI 5\fR it will allow the tests to run in parallel.
800 .br
801 Initial working directory: $S
802 .TP
803 .B src_install
804 Should contain everything required to install the package in the temporary
805 \fIinstall directory\fR.
806 .br
807 Initial working directory: $S
808
809 Beginning with \fBEAPI 4\fR, if src_install is undefined then the
810 following default implementation is used:
811
812 .nf
813 src_install() {
814     if [[ \-f Makefile || \-f GNUmakefile || \-f makefile ]] ; then
815         emake DESTDIR="${D}" install
816     fi
817
818     if ! declare -p DOCS &>/dev/null ; then
819         local d
820         for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \\
821                 THANKS BUGS FAQ CREDITS CHANGELOG ; do
822             [[ \-s "${d}" ]] && dodoc "${d}"
823         done
824     elif [[ $(declare \-p DOCS) == "declare \-a "* ]] ; then
825         dodoc "${DOCS[@]}"
826     else
827         dodoc ${DOCS}
828     fi
829 }
830 .fi
831 .TP
832 .B pkg_preinst pkg_postinst
833 All modifications required on the live\-filesystem before and after the
834 package is merged should be placed here. Also commentary for the user
835 should be listed here as it will be displayed last.
836 .br
837 Initial working directory: $PWD
838 .TP
839 .B pkg_prerm pkg_postrm
840 Like the pkg_*inst functions but for unmerge.
841 .br
842 Initial working directory: $PWD
843 .TP
844 .B pkg_config
845 This function should contain optional basic configuration steps.
846 .br
847 Initial working directory: $PWD
848
849 .SH "HELPER FUNCTIONS"
850 .SS "Phases:"
851 .TP
852 .B default
853 Calls the default phase function implementation for the currently executing
854 phase. This function is supported beginning with \fBEAPI 2\fR.
855 .TP
856 .B default_*
857 Beginning with \fBEAPI 2\fR, the default pkg_nofetch and src_* phase
858 functions are accessible via a function having a name that begins with
859 default_ and ends with the respective phase function name. For example,
860 a call to a function with the name default_src_compile is equivalent to
861 a call to the default src_compile implementation.
862
863 .RS
864 .TS
865 l
866 _
867 l.
868 Default Phase Functions
869 default_pkg_nofetch
870 default_src_unpack
871 default_src_prepare
872 default_src_configure
873 default_src_compile
874 default_src_test
875 .TE
876 .RE
877
878 .SS "General:"
879 .TP
880 .B die\fR \fI[reason]
881 Causes the current emerge process to be aborted. The final display will
882 include \fIreason\fR.
883
884 Beginning with \fBEAPI 4\fR, all helpers automatically call \fBdie\fR
885 whenever some sort of error occurs. Helper calls may be prefixed with
886 the \fBnonfatal\fR helper in order to prevent errors from being fatal.
887 .TP
888 .B nonfatal\fR \fI<helper>
889 Execute \fIhelper\fR and \fIdo not\fR call die if it fails.
890 The \fBnonfatal\fR helper is available beginning with \fBEAPI 4\fR.
891 .TP
892 .B use\fR \fI<USE item>
893 If \fIUSE item\fR is in the \fBUSE\fR variable, the function will silently
894 return 0 (aka shell true).  If \fIUSE item\fR is not in the \fBUSE\fR
895 variable, the function will silently return 1 (aka shell false).  \fBusev\fR
896 is a verbose version of \fBuse\fR.
897 .RS
898 .TP
899 .I Example:
900 .nf
901 if use gnome ; then
902         guiconf="\-\-enable\-gui=gnome \-\-with\-x"
903 elif use gtk ; then
904         guiconf="\-\-enable\-gui=gtk \-\-with\-x"
905 elif use X ; then
906         guiconf="\-\-enable\-gui=athena \-\-with\-x"
907 else
908         # No gui version will be built
909         guiconf=""
910 fi
911 .fi
912 .RE
913 .TP
914 .B usex\fR \fI<USE flag>\fR \fI[true output]\fR \fI[false output]\fR \fI[true suffix]\fR \fI[false suffix]
915 If USE flag is set, echo [true output][true suffix] (defaults to
916 "yes"), otherwise echo [false output][false suffix] (defaults to
917 "no"). The usex helper is available beginning with \fBEAPI 5\fR.
918 .TP
919 .B use_with\fR \fI<USE item>\fR \fI[configure name]\fR \fI[configure opt]
920 Useful for creating custom options to pass to a configure script. If \fIUSE
921 item\fR is in the \fBUSE\fR variable and a \fIconfigure opt\fR is specified,
922 then the string \fI\-\-with\-[configure name]=[configure opt]\fR will be echoed.
923 If \fIconfigure opt\fR is not specified, then just \fI\-\-with\-[configure
924 name]\fR will be echoed.  If \fIUSE item\fR is not in the \fBUSE\fR variable,
925 then the string \fI\-\-without\-[configure name]\fR will be echoed. If
926 \fIconfigure name\fR is not specified, then \fIUSE item\fR will be used in
927 its place. Beginning with \fBEAPI 4\fR, an empty \fIconfigure opt\fR argument
928 is recognized. In \fBEAPI 3\fR and earlier, an empty \fIconfigure opt\fR
929 argument is treated as if it weren't provided.
930 .RS
931 .TP
932 .I Examples:
933 .nf
934 USE="opengl"
935 myconf=$(use_with opengl)
936 (myconf now has the value "\-\-with\-opengl")
937
938 USE="jpeg"
939 myconf=$(use_with jpeg libjpeg)
940 (myconf now has the value "\-\-with\-libjpeg")
941
942 USE=""
943 myconf=$(use_with jpeg libjpeg)
944 (myconf now has the value "\-\-without\-libjpeg")
945
946 USE="sdl"
947 myconf=$(use_with sdl SDL all\-plugins)
948 (myconf now has the value "\-\-with\-SDL=all\-plugins")
949 .fi
950 .RE
951 .TP
952 .B use_enable\fR \fI<USE item>\fR \fI[configure name]\fR \fI[configure opt]
953 Same as \fBuse_with\fR above, except that the configure options are
954 \fI\-\-enable\-\fR instead of \fI\-\-with\-\fR and \fI\-\-disable\-\fR instead of
955 \fI\-\-without\-\fR. Beginning with \fBEAPI 4\fR, an empty \fIconfigure opt\fR
956 argument is recognized. In \fBEAPI 3\fR and earlier, an empty
957 \fIconfigure opt\fR argument is treated as if it weren't provided.
958 .TP
959 .B hasv\fR \fI<item>\fR \fI<item list>
960 If \fIitem\fR is in \fIitem list\fR, then \fIitem\fR is echoed and \fBhasv\fR
961 returns 0.  Otherwise, nothing is echoed and 1 is returned. As indicated with
962 use, there is a non\-echoing version \fBhas\fR. Please use \fBhas\fR in all
963 places where output is to be disregarded. Never use the output for calculation.
964 .br
965 The \fIitem list\fR is delimited by the \fIIFS\fR variable.  This variable
966 has a default value of ' ', or a space.  It is a \fBbash\fR(1) setting.
967 .TP
968 .B has_version\fR \fI[\-\-host\-root]\fR \fI<category/package\-version>
969 Check to see if \fIcategory/package\-version\fR is installed on the system.
970 The parameter accepts all values that are acceptable in the \fBDEPEND\fR
971 variable.  The function returns 0 if \fIcategory/package\-version\fR is
972 installed, 1 otherwise. Beginning with \fBEAPI 5\fR, the
973 \-\-host\-root option may be used in order to cause the query
974 to apply to the host root instead of ${ROOT}.
975 .TP
976 .B best_version\fR \fI[\-\-host\-root]\fR \fI<package name>
977 This function will look up \fIpackage name\fR in the database of currently
978 installed programs and echo the "best version" of the package that is
979 currently installed. Beginning with \fBEAPI 5\fR, the
980 \-\-host\-root option may be used in order to cause the query
981 to apply to the host root instead of ${ROOT}.
982
983 Example:
984 .nf
985         VERINS="$(best_version net\-ftp/glftpd)"
986         (VERINS now has the value "net\-ftp/glftpd\-1.27" if glftpd\-1.27 is installed)
987 .fi
988
989 .SS "Hooks:"
990 .TP
991 .B register_die_hook\fR \fI[list of function names]
992 Register one or more functions to call when the ebuild fails for any reason,
993 including file collisions with other packages.
994 .TP
995 .B register_success_hook\fR \fI[list of function names]
996 Register one or more functions to call when the ebuild builds and/or installs
997 successfully.
998
999 .SS "Output:"
1000 .TP
1001 .B einfo\fR \fI"disposable message"
1002 Same as \fBelog\fR, but should be used when the message isn't important to the
1003 user (like progress or status messages during the build process).
1004 .TP
1005 .B elog\fR \fI"informative message"
1006 If you need to display a message that you wish the user to read and take
1007 notice of, then use \fBelog\fR.  It works just like \fBecho\fR(1), but
1008 adds a little more to the output so as to catch the user's eye. The message
1009 will also be logged by portage for later review.
1010 .TP
1011 .B ewarn\fR \fI"warning message"
1012 Same as \fBeinfo\fR, but should be used when showing a warning to the user.
1013 .TP
1014 .B eqawarn\fR \fI"QA warning message"
1015 Same as \fBeinfo\fR, but should be used when showing a QA warning to the user.
1016 .TP
1017 .B eerror\fR \fI"error message"
1018 Same as \fBeinfo\fR, but should be used when showing an error to the user.
1019 .TP
1020 .B ebegin\fR \fI"helpful message"
1021 Like \fBeinfo\fR, we output a \fIhelpful message\fR and then hint that the
1022 following operation may take some time to complete.  Once the task is
1023 finished, you need to call \fBeend\fR.
1024 .TP
1025 .B eend\fR \fI<status>\fR \fI["error message"]
1026 Followup the \fBebegin\fR message with an appropriate "OK" or "!!" (for
1027 errors) marker.  If \fIstatus\fR is non\-zero, then the additional \fIerror
1028 message\fR is displayed.
1029
1030 .SS "Unpack:"
1031 .TP
1032 .B unpack\fR \fI<source>\fR \fI[list of more sources]
1033 This function uncompresses and/or untars a list of sources into the current
1034 directory. The function will append \fIsource\fR to the \fBDISTDIR\fR variable.
1035
1036 .SS "Compile:"
1037 .TP
1038 .B econf\fR \fI[configure options]
1039 This is used as a replacement for configure.  Performs:
1040 .nf
1041 ${\fIECONF_SOURCE\fR:-.}/configure \\
1042         ${CBUILD:+\-\-build=${CBUILD}} \\
1043         \-\-datadir="${EPREFIX}"/usr/share \\
1044         \-\-host=${CHOST} \\
1045         \-\-infodir="${EPREFIX}"/usr/share/info \\
1046         \-\-localstatedir="${EPREFIX}"/var/lib \\
1047         \-\-prefix="${EPREFIX}"/usr \\
1048         \-\-mandir="${EPREFIX}"/usr/share/man \\
1049         \-\-sysconfdir="${EPREFIX}"/etc \\
1050         ${CTARGET:+\-\-target=${CTARGET}} \\
1051         \-\-disable\-dependency\-tracking \\
1052         \fI${EXTRA_ECONF}\fR \\
1053         \fIconfigure options\fR || die "econf failed"
1054 .fi
1055 Note that the \fIEXTRA_ECONF\fR is for users only, not for ebuild
1056 writers.  If you wish to pass more options to configure, just pass the
1057 extra arguments to \fBeconf\fR. Also note that \fBeconf\fR automatically
1058 calls \fBdie\fR if the configure script fails.
1059 Beginning with \fBEAPI 3\fR, \fBeconf\fR uses the \fB${EPREFIX}\fR
1060 variable which is disregarded for prior \fBEAPI\fR values.
1061 Beginning with \fBEAPI 4\fR, \fBeconf\fR adds
1062 \fI\-\-disable\-dependency\-tracking\fR to the arguments if the
1063 string \fIdisable\-dependency\-tracking\fR occurs in the output
1064 of \fIconfigure \-\-help\fR.
1065 Beginning with \fBEAPI 5\fR, \fBeconf\fR adds
1066 \fIdisable\-silent\-rules\fR to the arguments if the
1067 string \fIdisable\-silent\-rules\fR occurs in the output
1068 of \fIconfigure \-\-help\fR.
1069 .TP
1070 .B emake\fR \fI[make options]
1071 This is used as a replacement for make.  Performs 'make ${MAKEOPTS}
1072 \fImake options\fR' (as set in make.globals), default is MAKEOPTS="\-j2".
1073
1074 .B ***WARNING***
1075 .br
1076 if you are going to use \fBemake\fR, make sure your build is happy with
1077 parallel makes (make \-j2).  It should be tested thoroughly as parallel
1078 makes are notorious for failing _sometimes_ but not always.  If you determine
1079 that your package fails to build in parallel, and you are unable to resolve
1080 the issue, then you should run '\fBemake\fR \-j1' instead of 'make'.
1081
1082 .SS "Install:"
1083 .TP
1084 .B einstall\fR \fI[make options]
1085 This is used as a replacement for make install.  Performs:
1086 .nf
1087 make \\
1088         prefix=${ED}/usr \\
1089         datadir=${ED}/usr/share \\
1090         infodir=${ED}/usr/share/info \\
1091         localstatedir=${ED}/var/lib \\
1092         mandir=${ED}/usr/share/man \\
1093         sysconfdir=${ED}/etc \\
1094         \fI${EXTRA_EINSTALL}\fR \\
1095         \fImake options\fR \\
1096         install
1097 .fi
1098 Please do \fBnot\fR use this in place of 'emake install DESTDIR=${D}'.
1099 That is the preferred way of installing make\-based packages.  Also, do
1100 not utilize the \fIEXTRA_EINSTALL\fR variable since it is for users.
1101
1102 .PD 0
1103 .TP
1104 .B prepall
1105 .TP
1106 .B prepalldocs
1107 .TP
1108 .B prepallinfo
1109 .TP
1110 .B prepallman
1111 .TP
1112 .B prepallstrip
1113 .PD 1
1114 Useful for when a package installs into \fB${D}\fR via scripts
1115 (i.e. makefiles).  If you want to be sure that libraries are executable,
1116 aclocal files are installed into the right place, doc/info/man files are
1117 all compressed, and that executables are all stripped of debugging symbols,
1118 then use these suite of functions.
1119 .RS
1120 .PD 0
1121 .TP
1122 .B prepall:
1123 Runs \fBprepallman\fR, \fBprepallinfo\fR, \fBprepallstrip\fR, sets
1124 libraries +x, and then checks aclocal directories.  Please note this
1125 does \fI*not*\fR run \fBprepalldocs\fR.
1126 .TP
1127 .B prepalldocs:
1128 Compresses all doc files in ${ED}/usr/share/doc.
1129 .TP
1130 .B prepallinfo:
1131 Compresses all info files in ${ED}/usr/share/info.
1132 .TP
1133 .B prepallman:
1134 Compresses all man files in ${ED}/usr/share/man.
1135 .TP
1136 .B prepallstrip:
1137 Strips all executable files of debugging symboles.  This includes libraries.
1138 .RE
1139
1140 .TP
1141 .B prepinfo\fR \fI[dir]
1142 .TP
1143 .B prepman\fR \fI[dir]
1144 .TP
1145 .B prepstrip\fR \fI[dir]
1146 .PD 1
1147 Similar to the \fBprepall\fR functions, these are subtle in their differences.
1148 .RS
1149 .PD 0
1150 .TP
1151 .B prepinfo:
1152 If a \fIdir\fR is not specified, then \fBprepinfo\fR will assume the dir
1153 \fIusr\fR. \fBprepinfo\fR will then compress all the files in
1154 ${ED}/\fIdir\fR/info.
1155 .TP
1156 .B prepman:
1157 If a \fIdir\fR is not specified, then \fBprepman\fR will assume the dir
1158 \fIusr\fR. \fBprepman\fR will then compress all the files in
1159 ${ED}/\fIdir\fR/man/*/.
1160 .TP
1161 .B prepstrip:
1162 All the files found in ${ED}/\fIdir\fR will be stripped.  You may specify
1163 multiple directories.
1164 .RE
1165 .PD 1
1166 .TP
1167 .B docompress\fR \fI[\-x] <path> [list of more paths]
1168 .RS
1169 Beginning with \fBEAPI 4\fR, the \fBdocompress\fR helper is used to
1170 manage lists of files to be included or excluded from optional compression.
1171 If the first argument is \fB\-x\fR, add each of its subsequent arguments to
1172 the exclusion list. Otherwise, add each argument to the inclusion list.
1173 The inclusion list initially contains \fI/usr/share/doc\fR,
1174 \fI/usr/share/info\fR, and \fI/usr/share/man\fR. The exclusion list
1175 initially contains \fI/usr/share/doc/${PF}/html\fR.
1176
1177 The optional compression shall be carried out after \fBsrc_install\fR
1178 has completed, and before the execution of any subsequent phase
1179 function. For each item in the inclusion list, pretend it has the
1180 value of the \fBD\fR variable prepended, then:
1181
1182 .RS
1183 If it is a directory, act as if every file or directory immediately
1184 under this directory were in the inclusion list.
1185
1186 If the item is a file, it may be compressed unless it has been
1187 excluded as described below.
1188
1189 If the item does not exist, it is ignored.
1190 .RE
1191
1192 Whether an item is to be excluded is determined as follows: For each
1193 item in the exclusion list, pretend it has the value of the \fBD\fR
1194 variable prepended, then:
1195
1196 .RS
1197 If it is a directory, act as if every file or directory immediately
1198 under this directory were in the exclusion list.
1199
1200 If the item is a file, it shall not be compressed.
1201
1202 If the item does not exist, it is ignored.
1203 .RE
1204 .RE
1205 .TP
1206 .B dosed\fR \fI"s:orig:change:g" <filename>
1207 Beginning with \fBEAPI 4\fR, the \fBdosed\fR helper no longer exists. Ebuilds
1208 should call \fBsed(1)\fR directly (and assume that it is GNU sed).
1209
1210 Performs sed in place on \fIfilename\fR inside ${ED}. If no expression is
1211 given then \fI"s:${D}::g"\fR is used as the default expression.  Note
1212 that this expression does \fBNOT\fR use the offset prefix.
1213 .br
1214 .BR 'dosed\ "s:/usr/local:/usr:g"\ /usr/bin/some\-script'
1215 runs sed on ${ED}/usr/bin/some\-script
1216 .TP
1217 .B dodir\fR \fI<path> [more paths]
1218 Creates directories inside of ${ED}.
1219 .br
1220 .BR 'dodir\ /usr/lib/apache'
1221 creates ${ED}/usr/lib/apache.  Note that the do* functions will run
1222 \fBdodir\fR for you.
1223 .TP
1224 .B diropts\fR \fI[options for install(1)]
1225 Can be used to define options for the install function used in
1226 \fBdodir\fR.  The default is \fI\-m0755\fR.
1227 .TP
1228 .B into\fR \fI<path>
1229 Sets the root (\fIDESTTREE\fR) for other functions like \fBdobin\fR,
1230 \fBdosbin\fR, \fBdoman\fR, \fBdoinfo\fR, \fBdolib\fR.
1231 .br
1232 The default root is /usr.
1233 .TP
1234 .B keepdir\fR \fI<path> [more paths]
1235 Tells portage to leave directories behind even if they're empty.  Functions
1236 the same as \fBdodir\fR.
1237 .TP
1238 .B dobin\fR \fI<binary> [list of more binaries]
1239 Installs a \fIbinary\fR or a list of binaries into \fIDESTTREE\fR/bin.
1240 Creates all necessary dirs.
1241 .TP
1242 .B dosbin\fR \fI<binary> [list of more binaries]
1243 Installs a \fIbinary\fR or a list of binaries into \fIDESTTREE\fR/sbin.
1244 Creates all necessary dirs.
1245 .TP
1246 .B doinitd\fR \fI<init.d script> [list of more init.d scripts]
1247 Install Gentoo \fIinit.d scripts\fR.  They will be installed into the
1248 correct location for Gentoo init.d scripts (/etc/init.d/).  Creates all
1249 necessary dirs.
1250 .TP
1251 .B doconfd\fR \fI<conf.d file> [list of more conf.d file]
1252 Install Gentoo \fIconf.d files\fR.  They will be installed into the
1253 correct location for Gentoo conf.d files (/etc/conf.d/).  Creates all
1254 necessary dirs.
1255 .TP
1256 .B doenvd\fR \fI<env.d entry> [list of more env.d entries]
1257 Install Gentoo \fIenv.d entries\fR.  They will be installed into the
1258 correct location for Gentoo env.d entries (/etc/env.d/).  Creates all
1259 necessary dirs.
1260
1261 .PD 0
1262 .TP
1263 .B dolib\fR \fI<library>\fR \fI[list of more libraries]
1264 .TP
1265 .B dolib.a\fR \fI<library>\fR \fI[list of more libraries]
1266 .TP
1267 .B dolib.so\fR \fI<library>\fR \fI[list of more libraries]
1268 .PD 1
1269 Installs a library or a list of libraries into \fIDESTTREE\fR/lib.
1270 Creates all necessary dirs.
1271 .TP
1272 .B libopts\fR \fI[options for install(1)]
1273 Can be used to define options for the install function used in
1274 the \fBdolib\fR functions.  The default is \fI\-m0644\fR.
1275 .TP
1276 .B doman\fR \fI[\-i18n=<locale>]\fR \fI<man\-page> [list of more man\-pages]
1277 Installs manual\-pages into /usr/share/man/man[0\-9n] depending on the
1278 manual file ending.  The files are compressed if they are not already.  You
1279 can specify locale\-specific manpages with the \fI\-i18n\fR option.  Then the
1280 man\-page will be installed into /usr/share/man/\fI<locale>\fR/man[0\-9n].
1281 Beginning with \fBEAPI 2\fR, a locale\-specific manpage which contains a locale
1282 in the file name will be installed in /usr/share/man/\fI<locale>\fR/man[0\-9n],
1283 with the locale portion of the file name removed, and the \fI\-i18n\fR option
1284 has no effect. For example, with \fBEAPI 2\fR, a manpage named
1285 foo.\fI<locale>\fR.1 will be installed as
1286 /usr/share/man/\fI<locale>\fR/man1/foo.1. Beginning with \fBEAPI 4\fR,
1287 the \fI\-i18n\fR option takes precedence over the locale suffix of the
1288 file name.
1289 .PD 0
1290 .TP
1291 .B dohard\fR \fI<filename> <linkname>
1292 Beginning with \fBEAPI 4\fR, the \fBdohard\fR helper no longer exists. Ebuilds
1293 should call \fBln(1)\fR directly.
1294 .TP
1295 .B dosym\fR \fI<filename> <linkname>
1296 .PD 1
1297 Performs the ln command to create a symlink.
1298 .TP
1299 .B doheader\fR \fI[\-r] <file> [list of more files]
1300 Installs the given header files into /usr/include/, by default
1301 with file mode \fI0644\fR (this can be overridden with the
1302 \fBinsopts\fR function). Setting \-r sets recursive. The
1303 \fBdoheader\fR helper is available beginning with \fBEAPI 5\fR.
1304 .TP
1305 .B dohtml\fR \fI [\-a filetypes] [\-r] [\-x list\-of\-dirs\-to\-ignore] [list\-of\-files\-and\-dirs]
1306 Installs the files in the list of files (space\-separated list) into
1307 /usr/share/doc/${PF}/html provided the file ends in .htm, .html, .css, .js, .gif, .jpeg, .jpg, or .png.
1308 Setting \fI\-a\fR limits what types of files will be included,
1309 \fI\-A\fR appends to the default list, setting \fI\-x\fR sets which dirs to
1310 exclude (CVS excluded by default), \fI\-p\fR sets a document prefix, \fI\-r\fR sets recursive.
1311 .TP
1312 .B doinfo\fR \fI<info\-file> [list of more info\-files]
1313 Installs info\-pages into \fIDESTDIR\fR/info.  Files are automatically
1314 gzipped.  Creates all necessary dirs.
1315 .TP
1316 .B domo\fR \fI<locale\-file> [list of more locale\-files]
1317 Installs locale\-files into \fIDESTDIR\fR/usr/share/locale/[LANG]
1318 depending on local\-file's ending.  Creates all necessary dirs.
1319
1320 .PD 0
1321 .TP
1322 .B fowners\fR \fI<permissions> <file> [files]
1323 .TP
1324 .B fperms\fR \fI<permissions> <file> [files]
1325 .PD 1
1326 Performs chown (\fBfowners\fR) or chmod (\fBfperms\fR), applying
1327 \fIpermissions\fR to \fIfiles\fR.
1328 .TP
1329 .B insinto\fR \fI[path]
1330 Sets the destination path for the \fBdoins\fR function.
1331 .br
1332 The default path is /.
1333 .TP
1334 .B insopts\fR \fI[options for install(1)]
1335 Can be used to define options for the install function used in
1336 \fBdoins\fR.  The default is \fI\-m0644\fR.
1337 .TP
1338 .B doins\fR \fI[\-r] <file> [list of more files]
1339 Installs files into the path controlled by \fBinsinto\fR.  This function
1340 uses \fBinstall\fR(1).  Creates all necessary dirs.
1341 Setting \-r sets recursive. Beginning with \fBEAPI 4\fR, both
1342 \fBdoins\fR and \fBnewins\fR preserve symlinks. In \fBEAPI 3\fR and
1343 earlier, symlinks are dereferenced rather than preserved.
1344 .TP
1345 .B exeinto\fR \fI[path]
1346 Sets the destination path for the \fBdoexe\fR function.
1347 .br
1348 The default path is /.
1349 .TP
1350 .B exeopts\fR \fI[options for install(1)]
1351 Can be used to define options for the install function used in \fBdoexe\fR.
1352 The default is \fI\-m0755\fR.
1353 .TP
1354 .B doexe\fR \fI<executable> [list of more executables]
1355 Installs executables into the path controlled by \fBexeinto\fR.  This function
1356 uses \fBinstall\fR(1).  Creates all necessary dirs.
1357 .TP
1358 .B docinto\fR \fI[path]
1359 Sets the subdir used by \fBdodoc\fR and \fBdohtml\fR
1360 when installing into the document tree
1361 (based in /usr/share/doc/${PF}/).  Default is no subdir, or just "".
1362 .TP
1363 .B dodoc\fR \fI[-r] <document> [list of more documents]
1364 Installs a document or a list of documents into /usr/share/doc/${PF}/\fI<docinto path>\fR.
1365 Documents are marked for compression.  Creates all necessary dirs.
1366 Beginning with \fBEAPI 4\fR, there is support for recursion, enabled by the
1367 new \fI\-r\fR option.
1368
1369 .PD 0
1370 .TP
1371 .B newbin\fR \fI<old file> <new filename>
1372 .TP
1373 .B newsbin\fR \fI<old file> <new filename>
1374 .TP
1375 .B newinitd\fR \fI<old file> <new filename>
1376 .TP
1377 .B newconfd\fR \fI<old file> <new filename>
1378 .TP
1379 .B newenvd\fR \fI<old file> <new filename>
1380 .TP
1381 .B newlib.so\fR \fI<old file> <new filename>
1382 .TP
1383 .B newlib.a\fR \fI<old file> <new filename>
1384 .TP
1385 .B newman\fR \fI<old file> <new filename>
1386 .TP
1387 .B newinfo\fR \fI<old file> <new filename>
1388 .TP
1389 .B newins\fR \fI<old file> <new filename>
1390 .TP
1391 .B newexe\fR \fI<old file> <new filename>
1392 .TP
1393 .B newdoc\fR \fI<old file> <new filename>
1394 .PD 1
1395 All these functions act like the do* functions, but they only work with one
1396 file and the file is installed as \fI[new filename]\fR.
1397 Beginning with \fBEAPI 5\fR, standard input is read when the
1398 first parameter is \- (a hyphen).
1399
1400 .SH "EXAMPLES"
1401 .DS
1402 .nf
1403 # Copyright 1999\-2009 Gentoo Foundation
1404 # Distributed under the terms of the GNU General Public License v2
1405 # $Header: $
1406
1407 EAPI="5"
1408
1409 inherit some_eclass another_eclass
1410
1411 DESCRIPTION="Super\-useful stream editor (sed)"
1412 HOMEPAGE="http://www.gnu.org/software/sed/sed.html"
1413 SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.gz"
1414
1415 LICENSE="GPL\-2"
1416 SLOT="0"
1417 KEYWORDS="~x86"
1418 IUSE=""
1419
1420 RDEPEND=""
1421 DEPEND="nls? ( sys-devel/gettext )"
1422
1423 src_configure() {
1424         econf \\
1425                 \-\-bindir="${EPREFIX}"/bin
1426 }
1427
1428 src_install() {
1429         emake DESTDIR="${D}" install
1430         dodoc NEWS README* THANKS AUTHORS BUGS ChangeLog
1431 }
1432 .fi
1433 .DE
1434
1435 .SH "FILES"
1436 .TP
1437 The \fI/usr/sbin/ebuild.sh\fR script.
1438 .TP
1439 The helper apps in \fI/usr/lib/portage/bin\fR.
1440 .TP
1441 .B /etc/make.conf
1442 Contains variables for the build\-process and overwrites those in make.defaults.
1443 .TP
1444 .B /usr/share/portage/config/make.globals
1445 Contains the default variables for the build\-process, you should edit
1446 \fI/etc/make.conf\fR instead.
1447 .TP
1448 .B /etc/portage/color.map
1449 Contains variables customizing colors.
1450
1451 .SH "SEE ALSO"
1452 .BR ebuild (1),
1453 .BR make.conf (5),
1454 .BR color.map (5)
1455
1456 .SH "REPORTING BUGS"
1457 Please report bugs via http://bugs.gentoo.org/
1458
1459 .SH "AUTHORS"
1460 .nf
1461 Achim Gottinger <achim@gentoo.org>
1462 Mark Guertin <gerk@gentoo.org>
1463 Nicholas Jones <carpaski@gentoo.org>
1464 Mike Frysinger <vapier@gentoo.org>
1465 Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@gmail.com>
1466 Fabian Groffen <grobian@gentoo.org>
1467 .fi