RPM::Spec - A very simplistic read-only method of accessing RPM spec files
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;
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.
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.
These methods each return the value of the given tag. If the tag is not present, undef is returned.
Note this will pick up from either of "Source" or "Source0" tags.
The "middle" of a spec; e.g. everything from the first %description until the changelog starts.
Documentation as this interface is likely to change in the Very Near Future.
Returns an array of strings representing the specfile.
Is the file empty?
Returns the line count of the specfile.
Given a coderef, greps through the content with it. See also grep.
Macros are not evaluated. e.g., if "Release: 1%{?dist}" is in your spec file, "1%{?dist}" will be returned by release().
We can't make any changes.
...
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.
Chris Weyl <cweyl@alumni.drew.edu>
Copyright (c) 2009 Chris Weyl <cweyl@alumni.drew.edu>
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the
Free Software Foundation, Inc. 59 Temple Place, Suite 330 Boston, MA 02111-1307 USA
To install RPM::Spec, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RPM::Spec
CPAN shell
perl -MCPAN -e shell install RPM::Spec
For more information on module installation, please visit the detailed CPAN module installation guide.