-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 425dc6e
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |