6. La Aplicación de Ebuilds

The ebuild application is a lower level interface to the Portage system.
Using this application you can execute specific actions against a given ebuild.
For instance, you can perform the individual merging steps by yourself.

Using ebuild is more for development purposes; more information about
ebuild can therefore be found in the Developers Handbook. However,
we will explain what ebuild instances are invoked by Portage during the merge
process of a certain software title, and how to invoke the post-configuration
steps some ebuilds allow you to perform.

Whenever you invoke ebuild against a given ebuild file, it will verify if
the checksums of all involved files are equal to those given in the
accompanying Manifest or
files/digest-<name>-<version> file. This
happens after the sources have been fetched.

To fetch the sources using ebuild, run:

Listado de Código 2.1: Fetching the sources

# ebuild path/to/ebuild fetch

If the ebuild's md5sum does not match the one listed in the
Manifest file, or one of the downloaded sources don't match those
listed in the files/digest-<package> file, you will receive
an error similar to this:

The next step in the merge process is to compile the sources. The
ebuild's compile functionality takes care of this step by executing the
src_compile() function in the ebuild. This also includes the configure steps if
appropriate.

Listado de Código 2.5: Compiling the sources

# ebuild path/to/ebuild compile

You are advised to edit the ebuild's src_compile() function if you want to
change the compilation instructions. However, you can also trick Portage into
believing that the ebuild application has finished the compile steps. Run
all necessary commands yourself and create an empty file called
.compiled in the working directory:

In the next step Portage will install all necessary files in a temporary
location. This directory will then contain all files that are to be merged on
the live filesystem. You can accomplish this by running ebuild's install
functionality, which executes the ebuild's src_install() function:

Some applications include instructions that configure the package further on
your system. These instructions can be interactive and are therefore not
automatically executed. To run these configuration steps, which are enlisted in
the ebuild's (optional) config() function, use ebuild's config
functionality:

You can instruct Portage to create a binary package of an ebuild or even an RPM
file. Use ebuild's package or rpm functionality to create these archives.
There are a few differences between those functionalities though:

The package functionality is a lot like the merge functionality, executing
all necessary steps (fetch, unpack, compile, install) before creating the
package

The rpm functionality builds an RPM package from the files created
after having run ebuild's install functionality