Building a Single Package

If you want to build and install a single package on your system, then the ./scripts/Emerge-Pkg script will download, build and install a package and all its dependencies. For example:

./scripts/Emerge-Pkg packagename

Emerge-Pkg will also check if the dependencies are installed and up-to-date. However with T2 systems installed from older stable trees this can result in a vast amount of dependencies, including systems tools, scheduled to build which not always might be desired. To avoid this the dependencies to include can be narrowed down by just installing missing dependencies:

./scripts/Emerge-Pkg -missing=only packagename

A complete repository, such as gnome2 or e17 (Enlightenment 17) can be built at once using the -repository option:

./scripts/Emerge-Pkg -repository gnome2

Note

Emerge-Pkg with the -repository option does only build selected packages. This is, because some packages - like alternative ghostscript or java variants - are deselection (optional) by default and Emerging a whole mail or printing repository would mess up the existing packages and cause so called shared files.

Emerging a whole repository, the option controlling what to do with yet uninstalled, missing packages come handy, if you - for example - have already specifically installed some some packages out of a big repository and just want to update them:

./scripts/Emerge-Pkg -missing=no -repository e17

If you know what you do, dependency resolution can be disabled entirely:

./scripts/Emerge-Pkg -deps=none packagename

Further options for ./scripts/Emerge-Pkg are:

Usage: Emerge-Pkg [ -cfg <config> ] [ -dry-run ] [ -force ] [ -nobackup ]
                  [ -consider-chksum ] [ -norebuild ]
                  [ -deps=none|fast|indirect ] [ -missing=yes|no|only ] [ -download-only ]
                  [ -repository repository-name ] [ -system ] [ pkg-name(s) ]

pkg-name(s) are only optional if a repository is specified.

Internally the Emerge-Pkg script runs the ./scripts/Build-Pkg as backend, which can alternatively be run manually, likewise. However keep in mind that the Build-Pkg script does neither download the package files nor check for dependencies! So for example:

./scripts/Download packagename
./scripts/Build-Pkg packagename

The results of the build can be found in /var/adm/log/9-packagename.log - or with the .err extension if it failed.

Usually you want to pass the option '-update' since this will backup modified configuration files and restore them after the package build finished.

Options for ./scripts/Build-Pkg are:

Usage: ./scripts/Build-Pkg [ -0 | -1 | -2  ... | -8 | -9 ]
                           [ -v ]  [ -xtrace ]  [ -chroot ]
                           [ -root { <rootdir> | auto } ]
                           [ -cfg <config> ]  [ -update ]
                           [ -prefix <prefix-dir> ]  [ -norebuild ]
                           [ -noclearsrc ]
                           [ -id <id> ]  [ -debug ]  pkg-name(s)

Both Emerge-Pkg as well as Build-Pkg will build and install a package into the root of the filesystem you initiate it in, that is it overwrites the ones currently installed.