Parse::RPM::Spec - Perl extension to parse RPM spec files.


Parse-RPM-Spec documentation  | view source Contained in the Parse-RPM-Spec distribution.

Index


NAME

Top

Parse::RPM::Spec - Perl extension to parse RPM spec files.

SYNOPSIS

Top

  use Parse::RPM::Spec;

  my $spec = Parse::RPM::Spec->new( { file => 'some_package.spec' } );

  print $spec->name;    # some_package
  print $spec->version; # 0.01 (for example)

DESCRIPTION

Top

RPM is the package management system used on Linux distributions based on Red Hat Linux. These days that includes Fedora, Red Hat Enterprise Linux, Centos, SUSE, Mandriva and many more.

RPMs are build from the source of a packages along with a spec file. The spec file controls how the RPM is built.

This module creates Perl objects which module spec files. Currently it gives you simple access to various pieces of information from the spec file.

CAVEAT

Top

This is still in development. I particular it doesn't currently parse all of a spec file. It just does the bits that I currently use. I will be adding support for the rest of the file very soon.

METHODS

Top

$spec = Parse::RPM::Spec->new('some_package.spec')

Creates a new Parse::EPM::Spec object. Takes one mandatory parameter which is the path to the spec file that you are interested in. Throws an exception if it doesn't find a valid spec.

$spec->parse_file('some_package.spec')

Parses the given spec file. This is called as part of the initialisation carried out by the new method, so there is generally no need to call it yourself.

$spec->file, $spec->name, $spec->version, $spec->epoch, $spec->release, $spec->summary, $spec->license, $spec->group, $spec->url, $spec->source, $spec->buildroot, $spec->buildarch, $spec->buildrequires, $spec->requires

Attribute accessors for the spec file object. Each one returns a piece of information from the spec file header. The source, buildrequires and requires methods are slightly different. Because these keys can have multiple values, they return a reference to an array of values.

Parse::RPM::Spec->meta

Moose-provided class method for introspection. Generally not needed by users.

EXPORT

None.

TO DO

Top

Plenty still to do here. Firstly, and most importantly, parsing the rest of the spec file.

SEE ALSO

Top

AUTHOR

Top

Dave Cross, <dave@mag-sol.com<gt>

COPYRIGHT AND LICENSE

Top


Parse-RPM-Spec documentation  | view source Contained in the Parse-RPM-Spec distribution.