Renuncia de responsabilidad:
Este manual ha sido sustituido por una versión más reciente y no tendrá
soporte de aquí en adelante.
|
[ << ]
[ < ]
[ Inicio ]
[ > ]
[ >> ]
6. The Ebuild Application
Contenido:
6.a. Emerge and Ebuild
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.
6.b. Manually Installing Software
Fetching the Sources & Checksumming
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:
Listado de Código 2.2: Ebuild checksum failure |
!!! File is corrupt or incomplete. (Digests do not match)
>>> our recorded digest: db20421ce35e8e54346e3ef19e60e4ee
>>> your file's digest: f10392b7c0b2bbc463ad09642606a7d6
|
The subsequent line will mention the erroneous file.
If you are certain that the sources you've fetched and the ebuild itself are
valid, you can regenerate the Manifest and
digest-<package> file using ebuild's digest
functionality:
Listado de Código 2.3: Regenerate Manifest and digest |
# ebuild path/to/ebuild digest
|
Unpacking the Sources
To unpack the sources in /var/tmp/portage (or any other directory
location you have specified in /etc/make.conf), run ebuild's
unpack functionality:
Listado de Código 2.4: Unpacking the sources |
# ebuild path/to/ebuild unpack
|
This will execute the ebuild's src_unpack() function (which defaults to plain
extraction if no src_unpack() function is defined). It is also in this step that
all necessary patches are applied.
Compiling the Sources
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:
Listado de Código 2.6: Informing Portage about the finished compilation jobs |
# touch .compiled
|
Installing the Files in a Temporary Location
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:
Listado de Código 2.7: Installing the files |
# ebuild path/to/ebuild install
|
Merging the Files onto the Live Filesystem
The final step is to merge all files onto the live filesystem and register those
in the Portage backend. ebuild calls this step "qmerge" and involves the
following steps:
- Execute the pkg_preinst() function if specified
- Copy over all files to the live filesystem
- Register the files in the Portage backend
- Execute the pkg_postinst() function if specified
Run ebuild's qmerge functionality to accomplish these steps:
Listado de Código 2.8: Merging the files on the live filesystem |
# ebuild path/to/ebuild qmerge
|
Cleaning the Temporary Directory
Finally you can clean the temporary directory using ebuild's clean
functionality:
Listado de Código 2.9: Cleaning the temporary directory |
# ebuild path/to/ebuild clean
|
6.c. Additional Ebuild Features
Running all Merge-related Commands
Using ebuild's merge functionality you can run the fetch, unpack,
compile, install and qmerge commands in one go:
Listado de Código 3.1: Installing software |
# ebuild path/to/ebuild merge
|
Performing Configuration Actions
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:
Listado de Código 3.2: Configuring a package |
# ebuild path/to/ebuild config
|
Building an (RPM) Package
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
Listado de Código 3.3: Creating packages |
# ebuild path/to/ebuild package
# ebuild path/to/ebuild rpm
|
The created RPM file however does not contain the ebuild's dependency
information.
6.d. More Information
Please consult the following man pages for more information about Portage, the
ebuild application and the ebuild files:
Listado de Código 4.1: Man pages |
$ man portage
$ man emerge
$ man ebuild
$ man 5 ebuild
|
You will also find more development-related information in the Developers Handbook.
[ << ]
[ < ]
[ Inicio ]
[ > ]
[ >> ]
El contenido de este documento, a no ser que se especifique
expresamente, está registrado bajo los términos de la licencia
CC-BY-SA-2.5. Se aplican las
Pautas de
Utilización del logotipo y nombre de Gentoo.
|