25 views

CHAPTER 12 - THE PACKAGE.XML FORMAT 2

name Attribute
This is the name of the file (for example, “Parser.php”).
You may also refer to a file in a subdirectory, in which case the directory part of
the file name is also included in the install path.
 

role Attribute
This attribute describes what type of file this is, or
what role the file has. Role is optional, and defaults to php. Possible values
include
php. PHP source file.
ext. Binary PHP extension, shared library/DLL.
src. C/C++ source file.
test. Regression test file.
doc. Documentation file.
Data. Data file; basically anything that does not fit any other role.
script. Executable script file.
 

platform Attribute
If the platform attribute is specified, the file
will be installed on specific platforms. The file will be included in the package
regardless of platform, but during installation, the file is skipped if the plat-
form specified in this attribute does not match the host’s platform.
Platform names are formatted as operatingsystem-version-cpu-extra.
Examples of the operatingsystem fragment are linux, windows, freebsd, hpux,
sunos, or irix. Only the operatingsystem fragment is required. The other frag-
ments may be omitted, in which case, the rule will match for any version or
variation of the operating system.
The version parameter is taken from the uname ­r command on UNIX.
Linux includes the first two digits of the kernel version, Microsoft Windows
uses 9x for Windows 95/98/ME, nt for Windows NT 3.x/4.x, 2000 for Windows
2000, or xp for Windows XP.
The cpu platform fragment is taken from uname ­m on UNIX, except that
all Intel x86 CPUs are represented as i386. Windows is hardcoded to i386
(sorry about that, Windows/alpha users).
Finally, the extra fragment is used for OS variations that affect binary
compatibility. Currently, it is used only to differentiate between Linux glibc
versions.
 

md5sum Attribute
This is the MD5 checksum of the file. The pear
package command automatically creates MD5 checksums of every file included
in the package, so it is never necessary–and not recommended–to explicitly set the md5sum attribute.

install-as Attribute
If, for some reason, the file should be
installed with a different name than the one included in the package, this
attribute specifies the alternate file name. Note that install-as does not affect
the directory to which the file is copied to, only the base file name used in that
directory.
 

debug and zts Attributes
The debug and zts attributes are only
set for files with the role attribute set to ext; PHP extension files. Both
attributes contain either yes or no, and tell whether the extension binary was
built with debug or thread-safety, respectively.
 

phpapi and zendapi Attributes
As with debug and zts, the phpapi
and zendapi attributes are also set only for files with role=ext. They describe
which versions of the PHP and Zend APIs were used when building the exten-
sion binary. PHP does not load extensions that are built with other API ver-
sions.
 

format Attribute
The format attribute is used for files with role=doc.
It tells which format the documentation is in. Example values include text,
dbxml412 (DocBook XML 4.1.2), or xhtml.
 

Element: <provides>
Element name: provides
Attributes:
name (required)
type (required)
May occur in:
release (optional)
The provides element describes definitions or features that the package
provides. The pear package command automatically detects which classes,
functions, and methods your package provides, and it embeds this information
in a bunch of <provides> elements inside the package tarball’s package.xml file.
 

name Attribute
This is the name of the entity being described, rep-
resented as N in the description of type.
 

type Attribute
The type attribute may have one of the following
values:
ext. Package provides extension N.
prog. Package provides program N.
class. Package provides class N.
function. Package provides function N.
feature. Package provides feature N.
api. Package provides the N interface/API.
feature is an abstract type, which lets you specify that “this package pro-
vides a way of doing N.”

Post a Comment

You must be logged in to post a comment.