RPM::Spec - A very simplistic read-only method of accessing RPM spec files


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

Index


NAME

Top

RPM::Spec - A very simplistic read-only method of accessing RPM spec files

SYNOPSIS

Top

    use RPM::Spec;

    my $spec = RPM::Spec->new('path/to/my.spec');

    say 'Version is: ' . $spec->version;
    say 'Spec has an epoch' if $spec->has_epoch;

DESCRIPTION

Top

WARNING: This code is actively being worked on, and the API may change.

RPM::Spec provides simplistic access to the different bits of information a spec file provides... It is basically a collection of different parsing routines that were scattered through a bunch of other modules.

CLASS FUNCTIONS

Top

new(specfile => [Str|File])

Create a new RPM::Specfile object. The only required parameter is 'specfile', which is either a string or Path::Class::File object pointing to the location of the specfile.

METHODS

Top

Tag Functions

These methods each return the value of the given tag. If the tag is not present, undef is returned.

license
epoch
release
version
source0

Note this will pick up from either of "Source" or "Source0" tags.

name
url
summary
middle

The "middle" of a spec; e.g. everything from the first %description until the changelog starts.

Dependency Functions

Documentation as this interface is likely to change in the Very Near Future.

Content Functions

content()

Returns an array of strings representing the specfile.

has_content

Is the file empty?

num_lines_in_content

Returns the line count of the specfile.

grep_content(sub { ... })

Given a coderef, greps through the content with it. See also grep.

CAVEATS

Top

No macro parsing

Macros are not evaluated. e.g., if "Release: 1%{?dist}" is in your spec file, "1%{?dist}" will be returned by release().

Read only!

We can't make any changes.

SEE ALSO

Top

...

BUGS AND LIMITATIONS

Top

Please report problems to Chris Weyl <cweyl@alumni.drew.edu>, or (preferred) to this package's RT tracker at <bug-RPM-Spec@rt.cpan.org>.

Patches are welcome.

AUTHOR

Top

Chris Weyl <cweyl@alumni.drew.edu>

LICENSE AND COPYRIGHT

Top


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