Portage (software)

From Wikipedia, the free encyclopedia

Jump to: navigation, search
Portage
Portage-oppdatering.png
Portage in action
Stable release 2.1.6.13
Preview release 2.2_rc61
Operating system Gentoo Linux and Gentoo/FreeBSD
Platform POSIX-compatible/Python-capable
Type Package management system
Website http://www.gentoo.org/proj/en/portage/

Portage is a package management system used by Gentoo, based on the concept of ports collections. Gentoo is sometimes referred to as a meta-distribution due to the extreme flexibility of Portage, which even allows it to manage other operating systems.[1][2][3][4] The Gentoo/ALT project is concerned with using Portage to manage other operating systems, such as BSDs, Mac OS X and Solaris. The most notable of these implementations is the Gentoo/FreeBSD project.

There is an ongoing effort called the Package Manager Specification project (PMS)[5] to standardise and document the behaviour of Portage, allowing the ebuild tree and Gentoo system packages to be used with alternate package managers such as Paludis and pkgcore. Its goal is to specify the behavior of package managers upon which Gentoo ebuilds can rely. There is a complete draft available[6].

Contents

[edit] Overview

[edit] Accessing Portage

Porthole graphical frontend.

Portage is similar to the BSD-style package management known as ports, and was originally designed with FreeBSD's ports in mind.[7] Portage is written in the Python programming language, and is the main utility that defines Gentoo. Although the system itself is known as Portage, it consists of two main parts, the ebuild system and emerge. The ebuild system takes care of the actual work of building and installing packages, while emerge provides an interface to ebuild: managing an ebuild repository, resolving dependencies and similar issues. (These two therefore have roughly the same relation as rpm has with yum, or dpkg has with APT.)

Two GTK+-based GUIs, Porthole and Portato, are available for working with Portage. There is also the Himerge GUI, which stands for "Haskell Interface for eMerge".

[edit] Functionalities provided

Portage is characterized by its main function: compiling from source the packages the user installs. In doing so it allows customizing package functionalities to the user's own wishes, and customizing all packages to the systems specifications. In order to accomplish this several functionalities are provided. Functionalities concerning managing the system are: allowing parallel package version installation, influencing cross-package functionalities, managing an installed-packages database, providing a local ebuild repository, and syncing of the local Portage tree with remote repositories. Functionalities concerning installing the individual package are: specifying compilation settings for the target machine, and influencing specified package components.

Portage distinguishes between three degrees of stability: stable, keyword masked and hard masked packages.

[edit] Features

[edit] Emerge

The emerge command-line tool is the heart of Portage. The command is customizable with many options and modifiers. The emerge tool is the most important utility for accessing the features of Portage from the command line.

The program calculates and manages dependencies, executes ebuilds and maintains the local Portage tree and database of installed packages. The compilation settings used by ebuilds can be changed through the CFLAGS environment variable, based on the specifications of the individual computer and on the user's desire for optimization. The emerge utility executes ebuilds in a sandbox environment. This way the system is protected from software executed by the ebuild and resulting binaries are only merged after a successful build and sandboxed install.

What emerge installs as dependencies is affected by the USE flag-settings. They decide which optional features will be included when installing or upgrading an application. The emerge command can also be used to download and install binary files.

[edit] USE flags

The Portage system offers the use of "USE flags," which allows users to indicate which software features they would like to include (and exclude) while building packages. For example, there is a USE flag to include DVD support, where available, in packages compiled with the flag enabled. The USE flags affect which dependencies are required, generally affecting which optional features will be built into a given program when it is compiled. For example, in packages which use a configure script, the USE flag feature would translate to ./configure --with-feature.

The specification of USE flags is the usual way to configure programs on Gentoo. USE flags may be set manually, or via user-friendly tools such as 'ufed' (USE flag editor), which lists flags along with their description. A list of available USE flags is available in the "Gentoo Linux Use Variable Descriptions" page of the Gentoo website.

[edit] Ebuild

Gentoo does not, by default, use binary packages as other package management systems do (like RPM), employing instead a format known as the ebuild. Whereas RPMs are precompiled binaries, ebuilds are shell scripts with variables and functions which contain a description of the software, and instructions on how to obtain, configure, compile, and install it, more closely akin to (but more powerful than) the .spec files distributed in SRPMs. There are over 25,000 ebuilds available, the majority of which are distributed by the Gentoo mirrors. New and updated ebuilds can be obtained by synchronizing the local ebuild repository with the mirrors. This is done by executing the command emerge --sync. Recently, Gentoo has begun providing pre-compiled binary packages for many common programs, especially those which are lengthy to compile, such as Mozilla Firefox and OpenOffice.org. These are still installed with emerge, just by appending a "-bin" to the package name to instead install the binary version.

[edit] Binary Packages

Gentoo does have a binary packaging format, which is a .tbz2 file (tar with bzip2 compression) with additional metadata. This feature enables the building of binary packages on one system (using Portage's buildpkg or quickpkg) followed by quick installation on other, identical systems (with Portage's getbinpkg or emerge -K). See Portage Features in the Gentoo Linux Handbook for more information.

[edit] Masking

Masking is how Gentoo determines which packages are suitable for a system. Ebuilds designed for different architectures or experimental software are usually masked in a manner which prevents a stable system from installing them without user intervention.

Packages that generally just require some testing but will often work fine are said to be keyword masked (i.e. they are available for systems with an ACCEPT_KEYWORDS make.conf entry starting with the character ~, such as ~x86, ~amd64, ~ppc). The standard way to unmask an individual keyword masked package is by adding a file with the full package name and keyword to /etc/portage/package.keywords/. Users can make subdirectories here as well, allowing for custom organization. For example, if a masked package had multiple masked dependencies, the user could make a directory with the name of the original masked package, and put all the mask files for the package and its dependencies in that directory. This scheme replaces the older scheme of having /etc/portage/package.keywords as a text file list.

Packages with known problems or not considered mature enough to be candidates for stable are hard masked by one of the various package.mask files in /usr/portage/profiles, and such entries are generally accompanied by a comment from developers explaining the reason for the mask.

[edit] See also

[edit] External links

Official documentation
Unofficial documentation
Similar software

[edit] References

  1. ^ Gentoo Linux - About Gentoo
  2. ^ My Workstation OS: Gentoo | Tom Chance's website
  3. ^ LinuxDevCenter.com - Gentoo Linux Reloaded
  4. ^ Interview with Gentoo's Daniel Robbins
  5. ^ Gentoo's official Package Manager Specification (PMS) project
  6. ^ PMS draft
  7. ^ Gentoo Linux Documentation - Making the distribution, Part 3