Linux: Own Gentoo Ebuild Creation

Time to time everyone figures out that there is an unavailable package in the standard Gentoo repository (portage). Therefore, it comes useful to extend the repository with portage overlays (e.g., with layman). What if this does not work either? It’s time to create your own ebuild.
There exists a complex how-to. However, the brief info is as follows. Once updated the /etc/make.conf with:

PORTDIR_OVERLAY="/usr/local/portage"

And integrate the new package in the package tree. For instance:

mkdir /usr/local/portage/dev-python
mkdir /usr/local/portage/dev-python/python-xklavier

In each package, the following four files are necessary (the ebuild name is an example):

  • ChangeLog
  • Manifest
  • metadata.xml
  • python-xklavier-0.4.ebuild

The ChangeLog file contains the brief information about the package changes. The Manifest file contains several rows referencing all files (four in this case) including their size (in Bytes) and respective checksums (using RMD160, SHA1, and SHA256 functions). The structure of Metadata.xml file can be as follows:



no-herd

  name@domain.tld
 Package description

The structure of the own ebuild can be found here or copied from any other package in the system (/usr/portage directory).
To calculate the checksums (for the Manifest file), the following commands can be applied:

openssl dgst -ripemd160 python-xklavier-0.4.tar.gz
sha1sum python-xklavier-0.4.tar.gz
sha256sum python-xklavier-0.4.tar.gz

Alternatively use the Whirlpool method:

openssl dgst -whirlpool python-xklavier-0.4.tar.gz
Advertisements
This entry was posted in Linux and tagged , , , , . Bookmark the permalink.