Gentoo Development Guide

Package and Category metadata.xml

The metadata.xml file is used to specify additional data about a package or category.

Category Metadata

For categories, metadata.xml specifies a long description (in English and optionally in other languages). The format is specified formally in GLEP 34, and the character set must be UTF-8 as specified by GLEP 31. A typical example:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
    <catmetadata>
            <longdescription lang="en">
                The app-vim category contains plugins and syntax file
                packages for the Vim text editor.
            </longdescription>
            <longdescription lang="de">
                Die Kategorie app-vim enthält Plugins und Syntax-Pakete
                für den Vim Texteditor.
            </longdescription>
    </catmetadata>

When creating a new category, creating a metadata.xml file along with a <longdescription> in English is mandatory. Translations are handled by any interested developer who speaks a language sufficiently well.

The correct way to commit a category metadata.xml file is currently:

xmllint --noout --valid metadata.xml
glep31check metadata.xml
cvs commit -m "Adding category metadata.xml for my-category" metadata.xml

Package Metadata

For packages, metadata.xml can specify a long description and maintainer information. If a long description in any language is provided, an English long description must be present. A typical example might look like:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
    <pkgmetadata>
        <herd>vim</herd>
        <maintainer>
            <email>ciaranm@gentoo.org</email>
            <name>Ciaran McCreesh</name>
        </maintainer>
        <longdescription lang="en">
            This package provides Vim syntax highlighting for Cfengine configuration
            files, and automatic filetype detection for these files based upon
            filename.
        </longdescription>
    </pkgmetadata>

All new packages must include a metadata.xml file which specifies at least a herd. If no herd is suitable, no-herd should be used, and at least one maintainer must be listed — however, if at all possible, find a herd willing to be listed.

Commits of package metadata files are handled by repoman. You should ensure that you have dev-libs/libxml2 installed so that the XML can be validated.