If you want to build and install a single package on your system, then the ./t2 install script will download, build and install a package and all its dependencies. For example:
./t2 install 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:
./t2 install -missing=only packagename
A complete repository, such as gnome2 or e17 (Enlightenment 17) can be built at once using the -repository option:
./t2 install -repository gnome2
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:
./t2 install -missing=no -repository e17
If you know what you do, dependency resolution can be disabled entirely:
./t2 install -deps=none packagename
Further options for ./t2 install 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 ./t2 build 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:
./t2 download packagename ./t2 build 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 ./t2 build are:
Usage: ./t2 build [ -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.