Portage Overlay Howto

Howto

  1. You cannot simply overwrite ebuilds in /usr/portage, as any such change will be discarded by next emerge sync command. You have to setup a portage overlay instead.
  2. Create a new directory that will be root of your own portage tree, e. g. /usr/local/portage.
  3. The structure under that directory match the /usr/portage structure. (It doesn't mean you have to create or copy all directories from /usr/portage. Leave the new directory empty.)
  4. Add the following line to your /etc/make.conf file (of course, replace /usr/local/portage by a path to your portage overlay directory as created in step 2):
    PORTDIR_OVERLAY=/usr/local/portage
  5. Put a new ebuild to appropriate subdirectory of your portage overlay directory. For example, to add openoffice-bin-1.1.5.ebuild to your portage overlay, you have to create /usr/local/portage/app-office/openoffice-bin/ directory and put your ebuild there.
  6. If there are some patches coupled to the ebuild, you have to put them to the files/ directory - e. g. to /usr/local/portage/app-office/openoffice-bin/files/.
  7. Change to the directory with your ebuild and invoke ebuild digest command on the ebuild - e. g. ebuild openoffice-bin-1.1.5.ebuild digest.
  8. You can now simply emerge the package, e. g. emerge =openoffice-bin-1.1.5. Your portage overlay precedes the regular portage tree, so your ebuild will be used even if there exists ebuild with the same name in the regular portage tree.

References