sys-apps/sed sys-libs/zlib net-misc/dhcp
Examples:
sys-apps/sed-4.0.5 sys-libs/zlib-1.1.4-r1 net-misc/dhcp-3.0_p2
Versions are normally made up of two or three numbers separated by periods, such as 1.2 or 4.5.2. This string may be followed by a character such as 1.2a or 4.5.2z. Note that this letter is not meant to indicate alpha, beta, etc... status. For that, use the optional suffix; either _alpha, _beta, _pre (pre-release), _rc (release candidate), or _p (patch). This means for the 3rd pre-release of a package, you would use something like 1.2_pre3. The suffixes here can be arbitrarily chained without limitation.
Examples:
>media-libs/libgd-1.6 >=media-libs/libgd-1.6 =media-libs/libgd-1.6 <=media-libs/libgd-1.6 <media-libs/libgd-1.6
Example:
~net-libs/libnet-1.0.2a
Example:
!app-text/dos2unix
Example:
!!<sys-apps/portage-2.1.4_rc1
Examples:
=dev-libs/glib-2* !=net-fs/samba-2*
Examples:
x11-libs/qt:3 ~x11-libs/qt-3.3.8:3 >=x11-libs/qt-3.3.8:3 =x11-libs/qt-3.3*:3
Examples:
dev-libs/icu:0/0 dev-libs/icu:0/49 dev-lang/perl:0/5.12 dev-libs/glib:2/2.30
Examples:
dev-libs/icu:* dev-lang/perl:* dev-libs/glib:*
Examples:
dev-libs/icu:= dev-lang/perl:= dev-libs/glib:=
Examples:
dev-libs/icu:0= dev-lang/perl:0= dev-libs/glib:2=
To implement the equals slot operator, the package manager will need to store the slot/sub-slot pair of the best installed version of the matching package. This syntax is only for package manager use and must not be used by ebuilds. The package manager may do this by inserting the appropriate slot/sub-slot pair between the colon and equals sign when saving the package's dependencies. The sub-slot part must not be omitted here (when the SLOT variable omits the sub-slot part, the package is considered to have an implicit sub-slot which is equal to the regular slot).
Examples:
dev-libs/icu:0/0= dev-libs/icu:0/49= dev-lang/perl:0/5.12= dev-libs/glib:2/2.30=
Example | Meaning |
foo[bar,baz] | foo must have both bar and baz enabled |
foo[-bar,baz] | foo must have bar disabled and baz enabled |
Compact Form | Equivalent Expanded Form |
foo[!bar?] | bar? ( foo ) !bar? ( foo[-bar] ) |
foo[bar=] | bar? ( foo[bar] ) !bar? ( foo[-bar] ) |
foo[!bar=] | bar? ( foo[-bar] ) !bar? ( foo[bar] ) |
Examples:
media-video/ffmpeg[threads(+)] media-video/ffmpeg[-threads(-)]
jpeg? ( media-libs/jpeg )
!nophysfs? ( dev-games/physfs )
This is often useful for those times when you want to want to add optional support for a feature and have it enabled by default.
gtk2? ( =x11-libs/gtk+-2* ) !gtk2? ( =x11-libs/gtk+-1* )
That way the default is the superior GTK2 library.
Example:
|| ( app-games/unreal-tournament app-games/unreal-tournament-goty )
Here we see that unreal-tournament has a normal version and it has a goty version. Since they provide the same base set of files, another package can use either. Adding a virtual is inappropriate due to the small scope of it.
Another good example is when a package can be built with multiple video interfaces, but it can only ever have just one.
Example:
|| ( sdl? ( media-libs/libsdl ) svga? ( media-libs/svgalib ) opengl? ( virtual/opengl ) ggi? ( media-libs/libggi ) virtual/x11 )
Here only one of the packages will be chosen, and the order of preference is determined by the order in which they appear. So sdl has the best chance of being chosen, followed by svga, then opengl, then ggi, with a default of X if the user does not specify any of the previous choices.
Note that if any of the packages listed are already merged, the package manager will use that to consider the dependency satisfied.
Example:
x11-base/xorg-server-1.20.5-r2 --> 'xorg-server-1.20.5'
Example:
x11-base/xorg-server-1.20.5-r2 --> 'xorg-server'
Example:
x11-base/xorg-server-1.20.5-r2 --> '1.20.5'
Example:
x11-base/xorg-server-1.20.5-r2 --> 'r2'
Example:
x11-base/xorg-server-1.20.5 --> '1.20.5' x11-base/xorg-server-1.20.5-r2 --> '1.20.5-r2'
Examples:
x11-base/xorg-server-1.20.5 --> 'xorg-server-1.20.5' x11-base/xorg-server-1.20.5-r2 --> 'xorg-server-1.20.5-r2'
Example:
x11-base/xorg-server-1.20.5-r2 --> 'x11-base'
Value | Meaning |
buildonly | source-build which is not scheduled for merge |
source | source-build which is scheduled for merge |
Contains the path that portage should use as the root of the live filesystem. When packages wish to make changes to the live filesystem, they should do so in the tree prefixed by ${ROOT}. Often the offset prefix needs to be taken into account here, for which the variable ${EROOT} is provided (see below). Do not modify this variable.
KEYWORDS works in conjunction with ACCEPT_KEYWORDS (see make.conf(5)) to implement a system of creating sets of different types of packages which can then be masked or unmasked en masse. In the Gentoo Linux project, they are used by the Gentoo arch teams to define what ebuilds are included in a particular CPU architecture's set of stable and unstable unmasked packages.
Here's how they work. For purposes of explanation, let's assume you have a stable x86-64bit system, typically referred to as "amd64". ARCH would be defined as "amd64". If you were using the stable build of Gentoo Linux, then ACCEPT_KEYWORDS would be set to "amd64" via profiles. Any ebuild that then has "amd64" in KEYWORDS will be unmasked by default.
On an "unstable" amd64 system, ACCEPT_KEYWORDS will be set to "amd64 ~amd64", with the tilde denoting "unstable." Then, if an ebuild has either "amd64" or "~amd64" in KEYWORDS, it will be keyword unmasked by default on that system. Similarly, if an ebuild is known to not be compatible with a particular architecture, the "-" prefix ( i.e. "-amd64") setting can be specified to mask it only on that arch. If you are developing ebuilds for Gentoo Linux, there are certain policies regarding KEYWORDS that you are expected to follow in order to align with Gentoo's arch team workflow. The most important policies are listed below:
It is possible to customize the behavior of ACCEPT_KEYWORDS and KEYWORDS on a per-package basis using package.accept_keywords and package.keywords files in profiles. See portage(5) for more information on using these files.
Beginning with EAPI 5, the SLOT variable may contain an optional sub-slot part that follows the regular slot and is delimited by a / 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. Refer to the Atom Slot Operators section for more information about sub-slot usage.
Starting from EAPI 7, tools should go into the BDEPEND variable instead, as DEPEND will only be installed into the system being built and hence cannot be executed when cross-compiling.
You may use the syntax described above in the Dependencies section.
In EAPI 3 or earlier, if this is not set, then it defaults to the value of DEPEND. In EAPI 4 or later, RDEPEND will never be implicitly set.
You may use the syntax described above in the Dependencies section.
This variable was formally introduced in EAPI 7 but was previously known as HDEPEND in the experimental EAPI 5-hdepend.
You may use the syntax described above in the Dependencies section.
This variable was introduced in EAPI 8.
You may use the syntax described above in the Dependencies section.
***WARNING***
Use this only as last resort to break cyclic dependencies!
You may use the syntax described above in the Dependencies section.
Behavior | Expression |
If flag1 enabled then flag2 enabled | flag1? ( flag2 ) |
If flag1 disabled then flag2 enabled | !flag1? ( flag2 ) |
If flag1 disabled then flag2 disabled | !flag1? ( !flag2 ) |
Must enable any one or more (inclusive or) | || ( flag1 flag2 flag3 ) |
Must enable exactly one but not more (exclusive or) | ^^ ( flag1 flag2 flag3 ) |
May enable at most one (EAPI 5 or later) | ?? ( flag1 flag2 flag3 ) |
Note that objects that violate these rules may fail on some architectures.
This variable is intended to be used on closed-source binary objects that cannot be altered.
This variable is intended to be used on objects that truly need executable stack (i.e. not those marked to need it which in fact do not).
This variable is intended to be used on files of binary packages which ignore CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, and LDFLAGS variables.
Beginning with EAPI 4, if src_install is undefined then the following default implementation is used:
src_install() { if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then emake DESTDIR="${D}" install fi if ! declare -p DOCS &>/dev/null ; then local d for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \ THANKS BUGS FAQ CREDITS CHANGELOG ; do [[ -s "${d}" ]] && dodoc "${d}" done elif [[ $(declare -p DOCS) == "declare -a "* ]] ; then dodoc "${DOCS[@]}" else dodoc ${DOCS} fi }
Default Phase Functions |
default_src_unpack |
default_src_prepare |
default_src_configure |
default_src_compile |
default_src_test |
Beginning with EAPI 4, all helpers automatically call die whenever some sort of error occurs. Helper calls may be prefixed with the nonfatal helper in order to prevent errors from being fatal.
if use gnome ; then guiconf="--enable-gui=gnome --with-x" elif use gtk ; then guiconf="--enable-gui=gtk --with-x" elif use X ; then guiconf="--enable-gui=athena --with-x" else # No gui version will be built guiconf="" fi
USE="opengl" myconf=$(use_with opengl) (myconf now has the value "--with-opengl") USE="jpeg" myconf=$(use_with jpeg libjpeg) (myconf now has the value "--with-libjpeg") USE="" myconf=$(use_with jpeg libjpeg) (myconf now has the value "--without-libjpeg") USE="sdl" myconf=$(use_with sdl SDL all-plugins) (myconf now has the value "--with-SDL=all-plugins")
In EAPI 5 and EAPI 6, the package is searched for in the build host if the --host-root option is given.
In EAPI 7 and later, the confusing --host-root option has been replaced with -b, which corresponds to a dependency satisfied by BDEPEND in the build host. Similarly, the -d option corresponds to DEPEND in SYSROOT and the -r option corresponds to RDEPEND in ROOT.
Example:
VERINS="$(best_version net-ftp/glftpd)" (VERINS now has the value "net-ftp/glftpd-1.27" if glftpd-1.27 is installed)
${ECONF_SOURCE:-.}/configure \ ${CBUILD:+--build=${CBUILD}} \ --datadir="${EPREFIX}"/usr/share \ --host=${CHOST} \ --infodir="${EPREFIX}"/usr/share/info \ --localstatedir="${EPREFIX}"/var/lib \ --prefix="${EPREFIX}"/usr \ --mandir="${EPREFIX}"/usr/share/man \ --sysconfdir="${EPREFIX}"/etc \ ${CTARGET:+--target=${CTARGET}} \ --disable-dependency-tracking \ ${EXTRA_ECONF} \ configure options || die "econf failed"Note that the EXTRA_ECONF is for users only, not for ebuild writers. If you wish to pass more options to configure, just pass the extra arguments to econf. Also note that econf automatically calls die if the configure script fails. Beginning with EAPI 3, econf uses the ${EPREFIX} variable which is disregarded for prior EAPI values. Beginning with EAPI 4, econf adds --disable-dependency-tracking to the arguments if the string disable-dependency-tracking occurs in the output of configure --help. Beginning with EAPI 5, econf adds disable-silent-rules to the arguments if the string disable-silent-rules occurs in the output of configure --help.
The MAKEOPTS variable is set by the user so they can enable features such as parallel builds; see make.conf(5) for more details.
The EXTRA_EMAKE knob is portage feature so developers can override things while debugging ebuilds; it is not part of any EAPI specification.
***WARNING***
You must make sure your build is happy with parallel makes (make -j2). It
should be tested thoroughly as parallel makes are notorious for failing
_sometimes_ but not always. If you determine that your package fails to build
in parallel, and you are unable to resolve the issue, then you should run
`emake -j1` explicitly. This is a last resort however as it can
significantly slow down builds on systems with lots of processors.
make \ prefix=${ED}/usr \ datadir=${ED}/usr/share \ infodir=${ED}/usr/share/info \ localstatedir=${ED}/var/lib \ mandir=${ED}/usr/share/man \ sysconfdir=${ED}/etc \ ${EXTRA_EINSTALL} \ make options \ installPlease do not use this in place of 'emake install DESTDIR=${D}'. That is the preferred way of installing make-based packages. Also, do not utilize the EXTRA_EINSTALL variable since it is for users.
The optional compression shall be carried out after src_install has completed, and before the execution of any subsequent phase function. For each item in the inclusion list, pretend it has the value of the D variable prepended, then:
If the item is a file, it may be compressed unless it has been excluded as described below.
If the item does not exist, it is ignored.
Whether an item is to be excluded is determined as follows: For each item in the exclusion list, pretend it has the value of the D variable prepended, then:
If the item is a file, it shall not be compressed.
If the item does not exist, it is ignored.
Performs sed in place on filename inside ${ED}. If no expression is
given then "s:${D}::g" is used as the default expression. Note
that this expression does NOT use the offset prefix.
'dosed s:/usr/local:/usr:g /usr/bin/some-script'
runs sed on ${ED}/usr/bin/some-script
# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="5" inherit some_eclass another_eclass DESCRIPTION="Super-useful stream editor (sed)" HOMEPAGE="http://www.gnu.org/software/sed/" SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="" RDEPEND="" DEPEND="nls? ( sys-devel/gettext )" src_configure() { econf \ --bindir="${EPREFIX}"/bin } src_install() { emake DESTDIR="${D}" install dodoc NEWS README* THANKS AUTHORS BUGS ChangeLog }
Achim Gottinger <achim@gentoo.org> Mark Guertin <gerk@gentoo.org> Nicholas Jones <carpaski@gentoo.org> Mike Frysinger <vapier@gentoo.org> Arfrever Frehtes Taifersar Arahesis <arfrever@apache.org> Fabian Groffen <grobian@gentoo.org>