aboutsummaryrefslogtreecommitdiff
blob: 6d0162a11e7637717e7773620a0050c128fcf52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
<?xml version="1.0"?>
<guide self="ebuild-writing/eapi/">
<chapter>
<title>EAPI Usage and Description</title>

<body>
<p>
The Package Manager Specification (PMS) is a standardization
effort to ensure that the ebuild file format, the ebuild repository format
(of which the portage tree is Gentoo's main incarnation) as well as behavior
of the package managers interacting with these ebuilds is properly written
down and agreed upon.
</p>

<p>
EAPI is a version defined in ebuilds and other package manager related files
which inform the package manager about the file syntax and content. It is,
in effect, the version of the package manager specification (PMS) that the
file adheres to.
</p>

<p>
This section provides usage and descriptions of the different EAPIs.
</p>

<section>
<title>Usage of EAPIs</title>
<body>
<important>
An overview about the important features of each EAPI is provided in the
appendix of the Package Manager Specification.  The two-page leaflet
can be printed out, consulted for reference and is available
as <c>app-doc/pms</c> in the main tree.
</important>
<p>
If EAPI is undefined in an ebuild, then EAPI=0 is selected.  You should
set the EAPI variable, by specifying it at the top of the ebuild:
</p>

<note>
Most developers prefer to set the EAPI version without quotes. However, the PMS allows single and double quotes as well.
</note>

<codesample lang="ebuild">
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5
inherit eutils

</codesample>

<important>
EAPI must only be defined in ebuild files, not eclasses. (eclasses may have
EAPI-conditional code)
</important>

<p>
When writing new ebuilds developers can choose whathever EAPI they think
is the best.  Using the features of the latest EAPI is encouraged.
</p>

</body>
</section>

<section>
<title>EAPI=1</title>
<body>

<ul>
	<li>
		<p><b>Default src_compile Phase Function</b></p>
		<p>
		Support for the <c>ECONF_SOURCE</c> variable, which is also supported by
		<c>econf</c>, has been added to the default <c>src_compile</c> implementation.
		</p>
		<codesample lang="ebuild">
src_compile() {
	if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
		econf
	fi
	if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ] ; then
		emake || die "emake failed"
	fi
}
		</codesample>
	</li>
	<li>
		<p><b>SLOT dependencies</b></p>
		<p>
		Any valid atom can be constrained to match a specific SLOT. This
		is accomplished by appending a colon to the atom, followed by a
		SLOT value.
		</p>
		<p>
		<b>SLOT dependency examples:</b>
		<ul>
			<li><c>x11-libs/qt:3</c></li>
			<li><c>~x11-libs/qt-3.3.8:3</c></li>
			<li><c>&gt;=x11-libs/qt-3.3.8:3</c></li>
			<li><c>=x11-libs/qt-3.3*:3</c></li>
		</ul>
		</p>
	</li>
	<li>
		<p><b>IUSE defaults</b></p>
		<p>
		Add + or - before the name of the use flag in IUSE to turn it on or off by
		default.
		</p>

		<important>
		The default USE-ordering is <c>USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d"</c>
		(see man make.conf)
		</important>
		<important>
		Disabling default IUSE is pretty much useless as it does not
		override the profile and user config (make.conf and package.use)
		</important>

		<codesample lang="ebuild">
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=1

IUSE="foo +bar"

		</codesample>
	</li>
</ul>

</body>
</section>


<section>
<title>EAPI=2</title>
<body>

<subsection>
<title>Helpers</title>
<body>
<ul>
	<li>
		<p><b>doman Language Support</b></p>
		<p>
		<c>doman</c> automatically detects language codes and puts it in the
		appropriate directory.
		<codesample lang="ebuild">
doman foo.1
# will go into /usr/share/man/man1/foo.1
doman foo.lang.1
# will go into /usr/share/man/lang/man1/foo.1 with EAPI=2
		</codesample>
		</p>
	</li>
</ul>
</body>
</subsection>

<subsection>
<title>Metadata</title>
<body>
<ul>
	<li>
		<p><b>Blocker Atoms</b></p>
		<p>
		<ul>
			<li>
				<p><b>New Meaning for Old Syntax</b></p>
				<p>
				Blocker atoms which use the previously existing !atom syntax now
				have a slightly different meaning. These blocker atoms indicate
				that conflicting packages may be temporarily installed
				simultaneously. When temporary simultaneous installation of
				conflicting packages occurs, the installation of a newer package
				may overwrite any colliding files that belong to an older package
				which is explicitly blocked. When such file collisions occur, the
				colliding files cease to belong to the older package, and they
				remain installed after the older package is eventually
				uninstalled. The older package is uninstalled only after any newer
				blocking packages have been merged on top of it.
			</p>
			</li>
			<li>
				<p><b>New !!atom Syntax</b></p>
				<p>
				A new !!atom syntax is now supported, for use in special cases for
				which temporary simultaneous installation of conflicting packages
				should not be allowed. If a given package happens to be blocked by
				a mixture of atoms consisting of both the !atom and !!atom
				syntaxes, the !!atom syntax takes precedence over the !atom
				syntax.
				</p>
			</li>
		</ul>
		</p>
	</li>
	<li>
		<p><b>USE Dependencies</b></p>
		<p>
		It is possible to depend on USE-flags of packages.
		</p>
		<p>Examples:
		<ul>
			<li><c>foo[bar]</c> means that package foo must have USE-flag bar
			enabled</li>
			<li><c>foo[bar,baz]</c> means that the package foo must have both
				the bar and baz USE-flags enabled
			</li>
			<li><c>foo[-bar,baz]</c> means that the package foo must have the
				bar USE-flag disabled and baz USE-flag enabled</li>
			<li><c>foo[bar?]</c> means <c>bar? ( foo[bar] ) !bar? ( foo )</c></li>
			<li><c>foo[!bar?]</c> means <c>bar? ( foo ) !bar? ( foo[-bar] )</c></li>
			<li><c>foo[bar=]</c> means <c>bar? ( foo[bar] ) !bar? ( foo[-bar] )</c></li>
			<li><c>foo[!bar=]</c> means <c>bar? ( foo[-bar] ) !bar? ( foo[bar] )</c></li>
		</ul>
		</p>
	</li>
	<li>
		<p><b>Customization of Output File Names in SRC_URI</b></p>
		<p>
		A new syntax is supported which allows customization of the output
		file name for a given URI. In order to customize the output file
		name, a given URI should be followed by a "<c>-&gt;</c>" operator which, in
		turn, should be followed by the desired output file name. As
		usual, all tokens, including the operator and output file name,
		should be separated by whitespace.
		</p>
		<p>Example:</p>
		<codesample lang="ebuild">
SRC_URI="http://dl.google.com/earth/client/GE4/release_4_3/GoogleEarthLinux.bin
                        -&gt; GoogleEarthLinux-${PV}.bin"
		</codesample>
	</li>
</ul>
</body>
</subsection>

<subsection>
<title>Phases</title>
<body>
<ul>
	<li>
		<p><b>New <c>src_prepare</c> Phase Function</b></p>
		<p>
		A new src_prepare function is called after the <c>src_unpack</c>
		function, with cwd initially set to <c>$S</c>.
		</p>
	</li>
	<li>
		<p><b>New <c>src_configure</c> Phase Function</b></p>
		<p>
		The configure portion of the <c>src_compile</c> function has been split
		into a separate function which is named <c>src_configure</c>. The
		<c>src_configure</c> function is called in-between the <c>src_prepare</c> and
		<c>src_compile</c> functions.
		</p>
		<p>The default <c>src_configure</c> and <c>src_compile</c>
		functions in EAPI=2:
		<codesample lang="ebuild">
src_configure() {
	if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
		econf
	fi
}

src_compile() {
	if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ] ; then
		emake || die "emake failed"
	fi
}
		</codesample>
		</p>
	</li>
	<li>
		<p><b>Execution Order of Phase Functions</b></p>
		<p>
		<ul>
			<li><c>pkg_setup</c></li>
			<li><c>src_unpack</c></li>
			<li><c>src_prepare</c></li>
			<li><c>src_configure</c></li>
			<li><c>src_compile</c></li>
			<li><c>src_test</c></li>
			<li><c>src_install</c></li>
			<li><c>pkg_preinst</c></li>
			<li><c>pkg_postinst</c></li>
			<li><c>pkg_prerm</c></li>
			<li><c>pkg_postrm</c></li>
		</ul>
		</p>
	</li>
	<li>
		<p><b>Default Phase Functions</b></p>
		<p>
		The default <c>pkg_nofetch</c> and <c>src_*</c> phase functions are now
		accessible via a function having a name that begins with <c>default_</c>
		and ends with the respective phase function name. For example, a
		call to a function with the name <c>default_src_compile</c> is equivalent
		to a call to the default <c>src_compile</c> implementation.
		</p>
		<p>The default phase functions are:
		<ul>
			<li><c>default_pkg_nofetch</c></li>
			<li><c>default_src_unpack</c></li>
			<li><c>default_src_prepare</c></li>
			<li><c>default_src_configure</c></li>
			<li><c>default_src_compile</c></li>
			<li><c>default_src_test</c></li>
		</ul>
		</p>
	</li>
	<li>
		<p><b>Default Phase Function Alias</b></p>
		<p>
		A function named "<c>default</c>" is redefined for each phase so that it
		will call the <c>default_*</c> function corresponding to the current
		phase. For example, a call to the function named "<c>default</c>" during
		the <c>src_compile</c> phase is equivalent to a call to the function
		named <c>default_src_compile</c>.
		</p>
	</li>
</ul>
</body>
</subsection>

</body>
</section>
<section>
<title>EAPI=3</title>
<body>

<ul>
	<li>
		<p><b>Gentoo Prefix support</b></p>
		<p>
			Support for the <c>EPREFIX</c>, <c>EROOT</c>, and <c>ED</c>
			variables. If an ebuild uses one of these, it must be EAPI3 aware.
			See <uri link="http://www.gentoo.org/proj/en/gentoo-alt/prefix/techdocs.xml#doc_chap2">Gentoo Prefix Techdocs</uri> for more information.
		</p>
	</li>
	<li>
		<p><b>unpack supports .xz and .tar.xz</b></p>
		<p>
			The <c>unpack</c> command supports xz-archives and xz-compressed tar
			files.
		</p>
	</li>
</ul>

</body>
</section>

<section>
<title>EAPI=4</title>
<body>

<subsection>
<title>Helpers</title>
<body>
<ul>
	<li>
		<p><b>utilities die on their own, unless the nonfatal command is used</b></p>
		<p>
			<!-- TODO link auf fuunction-reference -->
			Ebuild functions all die on their own in EAPI=4. In case that this
			non-zero exit status is expected, you may call <c>nonfatal function
			[arg,...]</c>.
		</p>
		<p>Example:</p>
		<codesample lang="ebuild">
EAPI=1
...
src_install() {
	emake DESTDIR="${D}" install || die "make install failed"
	dodoc ChangeLog README
}
		</codesample>
		<codesample lang="ebuild">
EAPI=4
...
src_install() {
	emake DESTDIR="${D}" install
	nonfatal dodoc ChangeLog README
}
		</codesample>
	</li>
	<li>
		<p><b>recursive dodoc</b></p>
		<p>
			<c>dodoc</c> supports <c>-r</c> as the first argument, which leads
			<c>dodoc</c> to install the specified documentation directory
			recursively into the docdir.
		</p>
		<p>Example:</p>
		<codesample lang="ebuild">
src_install() {
	default
	dodoc ChangeLog
	dodoc -r doc/
}
		</codesample>
	</li>
	<li>
		<p><b>doins symlink supports</b></p>
		<p>
			Within EAPI=4, <c>doins</c> supports installing symlinks as symlinks
			when installing recursively. For older EAPIs, the symlink behaviour
			is undefined.
		</p>
	</li>
	<li>
		<p><b>dosed and dohard are banned</b></p>
		<p>
			The <c>dosed</c> and <c>dohard</c> commands are banned in this EAPI.
		</p>
	</li>
	<li>
		<p><b>econf adds --disable-dependency-tracking</b></p>
		<p>
			Within EAPI=4, <c>econf</c> adds
			<c>--disable-dependency-tracking</c> to the default configure
			options.
		</p>
	</li>
	<li>
		<p><b>controllable compression via docompress</b></p>
		<p>
			To compress files in the destination-folder <c>${D}</c>, the
			<c>docompress</c> command may be used in <c>src_install</c>.
			To control which items should be compressed and which shouldn't
			be compressed, you may include or exclude directories or plain
			files. The default inclusion list contains:
			<ul>
				<li><c>/usr/share/doc</c></li>
				<li><c>/usr/share/info</c></li>
				<li><c>/usr/share/man</c></li>
			</ul>
			The default exclusion list contains:
			<ul>
				<li><c>/usr/share/doc/${PF}/html</c></li>
			</ul>
			When a directory is in- or excluded, all files and directories in
			the given directories shall be added to the corresponding list.
			If a file is in- or excluded, the file shall be added to the
			corresponding list (exclusion is stronger than inclusion <d/>
			if a file is in both lists, the inclusion will be ignored).
		</p>
		<p>
			If the first argument of <c>docompress</c> is <c>-x</c>, the items
			specified will be added to the exclusion list, otherwise they will
			be added to the inclusion list.
		</p>
		<note>
			When <c>docompress</c> is called, it is <e>not</e> required that
			the paths specified as its arguments are pointing to existing files
			or directories. However, if a file still doesn't exist when
			<c>src_install</c> has completed, it will be ignored with a
			warning.
		</note>
	</li>
</ul>
</body>
</subsection>

<subsection>
<title>Metadata</title>
<body>
<ul>
	<li>
		<p><b>use dependencies default</b></p>
		<p>
			In addition to the use-deps specified in EAPI=2, a <c>(+)</c> or
			<c>(-)</c> may be added to the use-dep to define a default-value in
			case the use-flag does not exist in the given package. The
			<c>(+)</c> means that this use-flag is assumed to be enabled,
			<c>(-)</c> the opposite.
			<p>Example:</p>
			<codesample lang="ebuild">
DEPEND="
	>=dev-libs/boost-1.32[boost(+)]
	sys-devel/gcc[openmp(-)]"
			</codesample>
		</p>
	</li>
</ul>
</body>
</subsection>

<subsection>
<title>Phases</title>
<body>
<ul>
	<li>
		<p><b>new pkg_pretend phase</b></p>
		<p>
			The new <c>pkg_pretend</c> phase can be used to do sanity checks
			before the main phase function sequence is run (meaning this phase is
			executed after the package manager has calculated the dependencies
			and before installing them).
			This phase typically checks for a kernel configuration and may
			<c>eerror</c> and <c>die</c> when needed.
			<important>
				There is no guarantee that the ebuild's dependencies are installed
				when this phase is called.
			</important>
			<important>
				As <c>pkg_pretend</c> is not called in the main phase function
				sequence, environment saving is not guaranteed.
			</important>
		</p>
		<p>Example:</p>
		<codesample lang="ebuild">
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=4
inherit linux-info
...

CONFIG_CHECK="FUSE_FS"
ERROR_FUSE_FS="this is an unrealistic testcase..."

pkg_pretend() {
	if use kernel_linux ; then
		if [[ -e "${ROOT}"/usr/src/linux/.config ]] ; then
			if kernel_is lt 2 6 30 ; then
				check_extra_config
			fi
		fi
	fi
}
		</codesample>
	</li>
	<li>
		<p><b>default src_install is no longer a no-op</b></p>
		<p>
			The default <c>src_install</c> function in EAPI=4:
		</p>
		<codesample lang="ebuild">
src_install() {
	if [[ -f Makefile ]] || [[ -f GNUmakefile]] || [[ -f makefile ]] ; then
		emake DESTDIR="${D}" install
	fi

	if ! declare -p DOCS >/dev/null 2>&amp;1 ; then
		local d
		for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS \
				FAQ CREDITS CHANGELOG ; do
			[[ -s "${d}" ]] &amp;&amp; dodoc "${d}"
		done
	elif declare -p DOCS | grep -q "^declare -a " ; then
		dodoc "${DOCS[@]}"
	else
		dodoc ${DOCS}
	fi
}
		</codesample>
	</li>
	<li>
		<p><b>pkg_info for non-installed packages</b></p>
		<p>
			The <c>pkg_info</c> function may also be called by the
			package manager for non-installed packages.
			Ebuild writers should note that dependencies may not be
			available.
		</p>
	</li>
</ul>
</body>
</subsection>

<subsection>
<title>Variables</title>
<body>
<ul>
	<li>
		<p><b>REQUIRED_USE</b></p>
		<p>
			The <c>REQUIRED_USE</c> variable contains a list of assertions that
			must be met by the configuration of USE flags to be valid for this
			ebuild. In order to be matched, a USE flag in a terminal element
			must be enabled (or disabled if it has an exclamation mark prefix).
		</p>
		<p>
			Essentially, <c>REQUIRED_USE</c> is an analogue of <c>DEPEND</c>
			style syntax. For example, to state that some combination is
			forbidden, i.e. "if <c>foo</c> is set, <c>bar</c> must be unset":
		</p>
		<codesample lang="ebuild">
REQUIRED_USE="foo? ( !bar )"
		</codesample>
		<p>
			To state "if <c>foo</c> is set, then at least one of <c>bar</c>,
			<c>baz</c>, and <c>quux</c> must be activated":
		</p>
		<codesample lang="ebuild">
REQUIRED_USE="foo? ( || ( bar baz quux ) )"
		</codesample>
		<p>
			To state "exactly one of <c>foo</c>, <c>bar</c>, or <c>baz</c> must
			be set, but not several":
		</p>
		<codesample lang="ebuild">
REQUIRED_USE="^^ ( foo bar baz )"
		</codesample>
		<p>
			Note that the last relationship is that of an Exclusive OR (XOR).
			While an XOR could be formed from usual <c>DEPEND</c> syntax, a
			specific <c>^^</c> operator has been added for this case.
		</p>
		<p>
			Finally, to state "at least one of <c>foo</c>, <c>bar</c>, or
			<c>baz</c> must be set":
		</p>
		<codesample lang="ebuild">
REQUIRED_USE="|| ( foo bar baz )"
		</codesample>

		<important>
			See section
			<uri link="::general-concepts/use-flags/#conflicting-use-flags" />
			for when (and when not) to use <c>REQUIRED_USE</c>.
		</important>
	</li>
	<li>
		<p><b>REPLACING_VERSIONS and REPLACED_BY_VERSION</b></p>
		<p>
			The <c>REPLACING_VERSIONS</c> variable contains a
			whitespace-separated list of all versions (<c>PVR</c>) of this
			package that are being replaced (uninstalled or overwritten) as a
			result of this install. It is a list, not a single optional value,
			to handle pathological cases such as installing <c>foo-2:2</c> to
			replace <c>foo-2:1</c> and <c>foo-3:2</c>.
		</p>
		<p>
			<c>REPLACING_VERSIONS</c> is valid in <c>pkg_preinst</c> and
			<c>pkg_postinst</c>. In addition, it may be available in
			<c>pkg_pretend</c> and <c>pkg_setup</c>, although you should take
			care to handle binary package creation and installation correctly
			when using it in these phases.
		</p>
		<p>
			The <c>REPLACED_BY_VERSION</c> variable contains the single version
			(<c>PVR</c>) of this package that is replacing us, if we are being
			uninstalled as part of an install, or an empty string otherwise.
			It is valid in <c>pkg_prerm</c> and <c>pkg_postrm</c>.
		</p>
	</li>
	<li>
		<p><b>MERGE_TYPE</b></p>
		<p>
			The <c>MERGE_TYPE</c> variable contains the type of package that
			is being merged. Possible values are:
			<dl>
				<dt><c>source</c></dt>
				<dd><p>
					if building and installing a package from source,
				</p></dd>
				<dt><c>binary</c></dt>
				<dd><p>
					if installing a binary package,
				</p></dd>
				<dt><c>buildonly</c></dt>
				<dd><p>
					if building a binary package without installing it.
				</p></dd>
			</dl>
		</p>
	</li>
	<li>
		<p><b>DOCS</b></p>
		<p>
			The <c>DOCS</c> variable is an array or whitespace-separated list
			of documentation files for the default <c>src_install</c> function
			to install using <c>dodoc</c>. If undefined, a reasonable default
			list is used. See the default <c>src_install</c> function above.
		</p>
	</li>
	<li>
		<p><b>AA and KV variables are gone</b></p>
		<p>
			The <c>AA</c> and <c>KV</c> variables are no longer set in EAPI=4.
		</p>
	</li>
	<li>
		<p><b>no more RDEPEND="${DEPEND}"</b></p>
		<p>
			When <c>RDEPEND</c> is unset, there will no longer be an automatic
			assignment of <c>RDEPEND="${DEPEND}"</c>.
		</p>
	</li>
</ul>
</body>
</subsection>

</body>
</section>

<section>
<title>EAPI=5</title>
<body>

<subsection>
<title>Metadata</title>
<body>
<ul>
	<li>
		<p><b>REQUIRED_USE supports new at-most-one-of operator</b></p>
		<p>
		The new <b>at-most-one-of</b> operator consists of the string <c>'??'</c>, and is satisfied if zero or one (but no more) of its child elements is matched.
		</p>
	</li>
	<li>
		<p><b>SLOT supports optional "sub-slot" part</b></p>
		<p>
		The <c>SLOT</c> variable may contain an optional <b>sub-slot</b> part that follows the regular slot and is delimited by a <c>/</c> character. The sub-slot must be a valid slot name. The sub-slot is used to represent cases in which an upgrade to a new version of a package with a different sub-slot may require dependent packages to be rebuilt. When the sub-slot part is omitted from the SLOT definition, the package is considered to have an implicit sub-slot which is equal to the regular slot.
		</p>
	</li>
	<li>
		<p><b>Slot operators and sub-slots in dependencies</b></p>
		<p>
		A slot dependency may contain an optional sub-slot part that follows the regular slot and is delimited by a <c>/</c> character. This can be useful for packages installing pre-built binaries that require a library with a specific soname version which corresponds to the sub-slot. For example:
		</p>
		<codesample lang="ebuild">
RDEPEND="dev-libs/foo:0/3"
		</codesample>
		<p>
		Dependency atoms can use <b>slot operators</b> to clarify what should happen if the slot and/or sub-slot of a runtime dependency changes:
		</p>
		<ul>
			<li>
			<c>:*</c> Indicates that any slot value is acceptable. In addition, for runtime dependencies, indicates that the package specifying the dependency will not break if the package matching the dependency is replaced by a different matching package with a different slot and/or sub-slot.
			</li>
			<li>
			<c>:=</c> Indicates that any slot value is acceptable. In addition, for runtime dependencies, indicates that the package specifying the dependency will break unless there is available a package matching the dependency and whose slot and sub-slot are equal to the slot and sub-slot of the best installed version that had matched this dependency at the time when the package specifying this dependency had been installed.
			</li>
			<li>
			<c>:slot=</c> Indicates that only a specific slot value is acceptable, and otherwise behaves identically to the <c>:=</c> operator.
				<note>
				use <c>:slot/subslot</c> without a <c>=</c> to depend on a specific slot and sub-slot pair; it's a syntax error to use <c>:slot/subslot=</c> in an ebuild.
				</note>
			</li>
		</ul>
		<p>
		The <c>:slot</c> dependency syntax continues to behave like in EAPI=4 or earlier, i.e. it indicates that only the specific slot value is acceptable, but the package will not break when the version matching the runtime dependency is replaced by a version with a different sub-slot.
		</p>
		<p>
		For example:
		</p>
		<codesample lang="ebuild">
RDEPEND="dev-libs/foo:2=
	&gt;=dev-libs/bar-0.9:=
	media-gfx/baz:*
	x11-misc/wombat:0"
		</codesample>
		<p>
		means that the package should be rebuilt when <c>foo:2</c> or <c>&gt;=bar-0.9</c> are upgraded to versions with different subslots, but that changes in subslots of <c>baz</c> or <c>wombat:0</c> should be ignored.
		</p>
	</li>
</ul>
</body>
</subsection>

<subsection>
<title>Profiles</title>
<body>
<ul>
	<li>
		<p><b>Profile stable USE forcing and masking</b></p>
		<p>
		In profile directories with an EAPI supporting stable masking, new USE configuration files are supported: <c>use.stable.mask</c>, <c>use.stable.force</c>, <c>package.use.stable.mask</c> and <c>package.use.stable.force</c>. These files behave similarly to previously supported USE configuration files, except that they only influence packages that are merged due to a stable keyword.
		</p>
	</li>
</ul>
</body>
</subsection>

<subsection>
<title>Helpers</title>
<body>
<ul>
	<li>
		<p><b>econf adds --disable-silent-rules</b></p>
		<p>
		This option will automatically be passed if <c>--disable-silent-rules</c> occurs in the output of <c>configure --help</c>.
		</p>
	</li>
	<li>
		<p><b>new* commands can read from standard input</b></p>
		<p>
		Standard input is read when the first parameter is <c>-</c> (a hyphen).
		</p>
	</li>
	<li>
		<p><b>New option --host-root for {has,best}_version</b></p>
		<p>
		This option <c>--host-root</c> will cause the query to apply to the host root instead of ROOT.
		</p>
	</li>
	<li>
		<p><b>New doheader helper function</b></p>
		<p>
		Installs the given header files into <c>/usr/include/</c>, by default with file mode <c>0644</c>. This can be overridden by setting <c>INSOPTIONS</c> with the <c>insopts</c> function.
		</p>
	</li>
	<li>
		<p><b>New usex helper function</b></p>
		<p>
		<!-- We probably need an example here -->
		<pre>
USAGE: usex &#9001;USE flag&#9002; [true output] [false output] [true suffix] [false suffix]
DESCRIPTION:
If USE flag is set, echo [true output][true suffix] (defaults to "yes"),
 otherwise echo [false output][false suffix] (defaults to "no").
		</pre>
		</p>
	</li>
</ul>
</body>
</subsection>

<subsection>
<title>Phases</title>
<body>
<ul>
	<li>
		<p><b>src_test supports parallel tests</b></p>
		<p>
		Unlike older EAPIs, the default <c>src_test</c> implementation will not pass the -j1 option to emake.
		</p>
	</li>
</ul>
</body>
</subsection>

<subsection>
<title>Variables</title>
<body>
<ul>
	<li>
		<p><b>EBUILD_PHASE_FUNC</b></p>
		<p>
		During execution of an ebuild phase function (such as <c>pkg_setup</c> or <c>src_unpack</c>),
		the <c>EBUILD_PHASE_FUNC</c> variable will contain the name of the phase function that is currently executing.
		</p>
	</li>
</ul>
</body>
</subsection>

</body>
</section>

</body>
</chapter>
</guide>