Kapitel 9. The package definition file package.xml

Inhaltsverzeichnis
Introduction to the package definition file package.xml

Introduction to the package definition file package.xml

The package definition file package.xml is, as the name already implies, a well-formed XML file that contains all information about a PEAR package.

This chapter will describe the allowed elements of the package definition file and it will discuss how to create such a file for your package.

Allowed elements

The toplevel element in package.xml is the element <package version="1.0">. The allowed sub elements are:

Once you have built your package.xml, you can check its conformance with the command

       $ pear package-validate package.xml
      
(or if you prefer, the shortcut pear pv package.xml).

Creating a package definition file

This package.xml can serve as a template for you as it already contains all necessary elements. In most cases you only need to change the character data between the tags in order to use the example in your package.

In this example you get to know a very handy feature: When you have a directory in your package that only contains files of the same type, you can add to role attribute even to the <dir> tag instead of adding it to every singe <file> tag.

With the knowledge you aquired during this chapter you should now be able to produce a package definition file for your own package. If you still have questions concerning the topic, don't hesitate to ask on the mailinglist.