Alister West

home is where your code is ...

Gentoo Emerge

Note2self: See company specific notes.

Common emerge commands

layman -S           # sync localbox overlay with global
emerge --sync       # pull down emerge list

emerge -s <str>                 # search
emerge -s "%@^dev-lib.*apr$"    # search category

emerge -pv <pkg>    # what would happen if i installed pkg
emerge <pkg>        # install package

emerge -upvD world  # update all modules

qfile /path/to/file # what pkg installed this file
qlist -I            # show installed modules

Masked (unstable) ebuild

# Install if masked
echo "net-mail/foo" >> /etc/portage/package.keywords

# Add flags for compilation (php with curl and ftp support)
echo "dev-lang/php ftp curl" >> /etc/portage/package.use
emerge php

# Create a masked/unstable ebuild by appending ~ to arch
grep "KEYWORDS" ${EBUILD}
KEYWORDS="~x86 ~amd64"   # unstable package both arch's

Creating an ebuild

# Setup some stuff
VERSION=1.2.3
DISTFILE=foo-${VERSION}.tar.gz 
EBUILD=foo-${VERSION}.ebuild
PACKAGE=net-mail/foo
COMPANY=alister

Make sure you have a valid ebuild distribution file.

# Create a tar-zipped archive and an .ebuild file for the version.
tar  tf ${DISTFILE}
foo-1.2.3/README
foo-1.2.3/...

Local Emerge Install

cp  -fv  ${DISTFILE} /var/portage/distfiles
cp  -fv  ${EBUILD}   /var/lib/layman/${COMPANY}-overlay/${PACKAGE}
ebuild  --force   /var/lib/layman/${COMPANY}-overlay/${PACKAGE}/${EBUILD}  digest

Global Portage Archive

cp  -fv  ${DISTFILE} /var/${COMPANY}-portage/distfiles/
cp  -fv  ${EBUILD}   /var/${COMPANY}-portage/overlay/${PACKAGE}
ebuild  /var/${COMPANY}-portage/overlay/${PACKAGE}/${EBUILD}  digest
By Alister West