Gentoo Logo
Gentoo Logo Side

[ << ] [ < ] [ Home ] [ > ] [ >> ]


4. Gentoo Metadata

Content:

4.a. Why the need for metadata.xml?

The metadata.xml file has as its purpose to give extra information about ebuilds. The metadata.xml file should exist in every package directory. A skel file can be found as skel.metadata.xml in the portage tree.

Note: Please run xmllint --valid metadata.xml before committing a metadata.xml file. We hope to add support for metadata.xml to repoman soon.

4.b. Metadata Structure

A metadata.xml file can contain a number of tags:

tag description
<pkgmetadata> This is the root element of the metadata.xml file. It has no attributes. Its required subtag is: <herd>. Further the following subtags are allowed: <email> for a general herd email address, <maintainer>, and <longdescription>.
<herd> There must at least be one herd subtag. The contents of this tag should be the name of be a herd as specified in the herds.xml file. It must occur at least once.
<maintainer> Besides being member of a herd, a package can also be maintained directly. The maintainers of a package can be specified with the <maintainer> tag. This tag has one required subtag: <email>. It has two optional subtags: <name>, and <description>.
<email> This contains the e-mail address of the maintainer. It is required.
<name> This contains freetext with the name of the maintainer. It is optional.
<description> The description tag contains a description of the maintainership, or for example a remark that someone interested can take over the maintainership. It is optional.
<longdescription> This tag contains a description of the package. This is to augment the DESCRIPTION field in the ebuilds themselves.

There are also some attributes that can be used with these tags. They are all optional:

attribute tags description
lang <description>, <longdescription> In every case where a description is required, there must be at least an english description. If an additional description in another language is given, this attribute is used to specify the language used. The format is a two-character country code.
restrict <herd>, <maintainer>, <longdescription> The restrict attribute allows to restrict the application of certain tags to certain versions of a package. When this attribute is used, a tag without this attribute must also exist. That tag without the restrict attribute will serve as the default. The format of the restrict attribute is that of the DEPEND flag, except that "<" and ">" need to be specified by &lt; and &gt;.

For example in the db package restrict=">=sys-libs/db-3.2.9-r5" on the maintainer tag shows that I'm currently maintaining all versions bigger then 3.2.9-r5.

4.c. Metadata Examples

First Example

In this first example we provide you with the metadata.xml for OpenOffice of which the ebuilds are completely managed by a herd called openoffice:

Code Listing 1: Herd-managed package

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
  <herd>openoffice</herd>
  <longdescription>
    OpenOffice is the  opensource version of staroffice.
    This ebuild allows you to compile it yourself. Unfortunately this
    compilation can take up to a day depending on the speed of your
    computer. It will however make a snappier openoffice than the binary
    version.
  </longdescription>
</pkgmetadata>

The openoffice herd is defined in herds.xml by the Gentoo Metastructure Project:

Note: This example may be outdated when you read it. It's just an example!

Code Listing 2: OpenOffice Herd Example

<herd>
  <name>openoffice</name>
  <email>openoffice@gentoo.org</email>
  <description>openoffice related packages</description>
  <maintainer><email>pauldv@gentoo.org</email></maintainer>
  <maintainer><email>brad@gentoo.org</email></maintainer>
</herd>

If you want to add (or remove) yourself from a herd, edit herds.xml located in [gentoo]/misc in Gentoo's CVS repository. Make sure you know the e-mail alias the herd listens to (for instance the "sound" herd has sound@gentoo.org) and add yourself to the alias (by editing /var/mail/alias/misc/<alias name> on dev.gentoo.org).

Second Example

As second example we view the metadata.xml of mirrorselect. This ebuild is maintained by the tools-portage herd, but has a separate maintainer.

Code Listing 3: Herd & individually maintained package

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
  <herd>tools-portage</herd>
  <maintainer>
    <email>johnm@gentoo.org</email>
    <name>John Mylchreest</name>
  </maintainer>
  <longdescription>
    This utility is used to select the fastest mirror (distfiles) and provide a
    nicer front-end for mirror selection (both rsync + distfiles) to a user.
  </longdescription>
</pkgmetadata>

[ << ] [ < ] [ Home ] [ > ] [ >> ]



The contents of this document are licensed under the Creative Commons - Attribution / Share Alike license.
Print
line
Updated­ ˜úXember 09, 2004
line
Donny Davies
Ebuild HOWTO - Author

Peter Gavin
Author

Karl Trygve Kalleberg
Author

Mike Frysinger
Author

Daniel Robbins
Author/Editor

John P. Davis
Author/Editor

Jorge Paulo
Editor

Sven Vermeulen
Editor

Zack Gilburd
Editor

Benny Chuang
Editor

Erwin
Editor

Dan Armak
Eclass HOWTO - Author

Alastair Tse
Common Ebuild Mistakes - Author

Paul De Vrieze
Metadata Document - Author

Owen Stampflee
Ebuild Policy - Original Author

Seemant Kulleen
Editor

Jon Portnoy
Editor

Carl Anderson
Editor

Ciaran McCreesh
Contributor

Nicholas D. Wolfwood
Contributor

Marius Mauch
Contributor

Tim Yamin
Author/Editor

Gentoo Developer Relations Team
Editors

line
Summary:  This section explains the use and need of metadata.xml that is used within the Portage tree.
line
$99/mo dedicated servers

No BS Dedicated Gentoo Linux Servers from vr.org.

line
Tek Alchemy

Tek Alchemy offers dedicated servers and other hosting solutions running Gentoo Linux.

line
php|architect

php|architect is the monthly magazine for PHP professionals, available worldwide in print and electronic format. A percentage of all the sales will be donated back into the Gentoo project.

line
SevenL.net

Seven L Networks provides customizable Dedicated Servers for your customized Gentoo install. Colocation and other hosting services are also provided.

line
The Gentoo Linux Store
line
Copyright 2001-2004 Gentoo Foundation, Inc. Questions, Comments, Corrections? Email www@gentoo.org.