Skip to content

Commit

Permalink
Initial checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
perlpilot committed Jul 13, 2010
0 parents commit 425dc6e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use inc::Module::Install;

all_from 'lib/Module/Install/RPM.pm';

WriteAll;
54 changes: 54 additions & 0 deletions lib/Module/Install/RPM.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package Module::Install::RPM;

use strict; use warnings;
use parent 'Module::Install::Base';

our $VERSION = '0.01';

sub requires_rpm {
my ($self, $rpm, $version) = @_;

unless ($self->can_run('rpm')) {
warn "Unable to locate ``rpm'' executable\n";
return;
}

my $query = qx(rpm -q $rpm);
my @parts = split /-/, $query;
pop @parts; # remove patch level
my $rpm_version = pop @parts;
my ($rpm_name) = $query =~ m/(.*?)-\d/;


print "$query\n$rpm_version\n$rpm_name\n";

# system('rpm', $rpm);
}

1;

__END__
=head1 NAME
Module::Install::RPM - provide that certain RPMs be installed
=head1 SYNOPSIS
use inc::Module::Install;
name 'Your-Module';
all_from 'lib/Your/Module.pm';
requires_rpm 'gd';
requires_rpm 'httpd' => '2.2';
WriteAll;
=head1 AUTHOR
Jonathan Scott Duff <duff@pobox.com>
=head1 LICENSE
This software is licensed under the same terms as Perl.

0 comments on commit 425dc6e

Please sign in to comment.