3 # Make a bundle file from an RPM
7 $ENV{PATH} = '/bin:/usr/bin/';
11 # These are Perl dependencies that should be ignored/suppressed
14 foreach (qw/strict subs vars FS/) {
18 ## These are root packages that shouldn't be cited multiple times
19 ## Should figure this out with CPAN
26 foreach my $rawrpm (@ARGV) {
27 $rawrpm =~ /^([-\.a-z0-9\/]+)\s*$/i;
29 my @parts = split '/', $rpm;
30 my $name = pop @parts;
32 if ($name =~ m<([^/]+?)[-._]?v?-?([-_.\d]+[a-z]*?\d*)\.\w+\.rpm$>) {
36 print STDERR "rpm: $rpm ($name, $version)\n";
37 my @deps = sort `rpm -qp --requires $rpm`;
42 if (/^perl\((.*)\)\s*(>=\s+([\d\.]+))?$/) {
43 next if exists($suppress{$1});
44 my @parts = split /::/, $1;
45 if (scalar @parts > 1) {
46 next if exists($suppress{$parts[0]});
50 print STDERR " >= $3" if $3;
53 $mods{$1} = $3 ? $3 : undef;
60 package Bundle::$name;
62 \$VERSION = '$version';
70 Bundle::$name - A bundle to install prerequisites for the $name package
74 C<perl -MCPAN -e 'install Bundle::$name'>
83 This bundle includes all prerequisites needed by the $name package.
89 foreach (sort keys %mods) {
91 print " $mods{$_}" if exists($mods{$_}) && $mods{$_};