LinuxCommandLibrary

ebuild

Build and install software packages

TLDR

Create or update the package manifest

$ ebuild [path/to/file.ebuild] manifest
copy

Clean the temporary build directories for the build file
$ ebuild [path/to/file.ebuild] clean
copy

Fetch sources if they do not exist
$ ebuild [path/to/file.ebuild] fetch
copy

Extract the sources to a temporary build directory
$ ebuild [path/to/file.ebuild] unpack
copy

Compile the extracted sources
$ ebuild [path/to/file.ebuild] compile
copy

Install the package to a temporary install directory
$ ebuild [path/to/file.ebuild] install
copy

Install the temporary files to the live filesystem
$ ebuild [path/to/file.ebuild] qmerge
copy

Fetch, unpack, compile, install and qmerge the specified ebuild file
$ ebuild [path/to/file.ebuild] merge
copy

SYNOPSIS

ebuild ebuild_file action

PARAMETERS

ebuild_file
    The path to the ebuild file to be processed. This file contains the instructions for building and installing the software.

action
    The action to perform on the specified ebuild file. Common actions include: fetch (download source code), unpack (extract source code), prepare (apply patches), configure (run configure script), compile (compile source code), install (install compiled files), package (create a binary package), merge (install the package onto the system), unmerge (uninstall the package), clean (remove temporary build files), depend (resolve and install dependencies), digest (generate digests/checksums), manifest (create or update the Manifest file). The actual actions will depend on the eclass features used by the ebuild.

DESCRIPTION

The ebuild command is the central tool for managing packages within the Gentoo Linux distribution. It acts as the primary interface for working with ebuild files, which are essentially build scripts that contain all the necessary instructions for downloading, configuring, compiling, and installing software from source. It facilitates dependency resolution, fetching sources, applying patches, running configure scripts, building the application, and installing it into the system. This command is the core of the Portage package management system and ensures a high degree of flexibility and customization in package management.
It provides an abstraction layer for interacting with the build process, allowing users to manage software installations without directly dealing with the complexities of compiling from source. The ebuild command interacts with the Portage system to handle dependencies, ensure system integrity, and provide a controlled and reproducible build environment. Portage uses the ebuild command to automate package creation in the chroot/jail environment.

CAVEATS

The ebuild command requires root privileges for certain actions such as install, merge, and unmerge. Incorrect usage of ebuild can lead to system instability or broken packages. Always consult the Gentoo documentation and the ebuild file before executing commands, especially when modifying system-critical packages.

EBUILD FILE FORMAT

Ebuild files are shell scripts that define the build process for a particular piece of software. These files contain metadata, dependency information, and instructions for downloading, compiling, and installing the software. Variables like SRC_URI (source URI), DEPEND (dependencies), S (source directory), pkg_setup(), src_compile(), and src_install() are used to define the steps in the build process. Developers and users can modify these files to customize the build process or adapt software to specific system configurations.

USE FLAGS

USE flags are a powerful feature of Gentoo that allows users to enable or disable specific features during the compilation process. By setting USE flags in /etc/portage/make.conf, users can control which options are enabled when building a package. The ebuild command respects these USE flags and incorporates them into the build process, enabling or disabling features as specified. This level of customization allows users to tailor their software installations to their specific needs and preferences.

HISTORY

The ebuild command is a core component of the Portage package management system, which was developed specifically for Gentoo Linux. Its development began in the late 1990s with the initial design of Portage and has continued since then. The initial design focused on building a highly customizable and source-based distribution. The development of ebuild enabled users to build and manage packages effectively and reproducibly. It supports various actions for different package manipulations. The command has undergone several revisions and improvements over the years, evolving alongside the Gentoo Linux distribution to meet its specific needs.

SEE ALSO

emerge(1), equery(1), portage(5)

Copied to clipboard