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 || /^perl-(.*)\s*((>=|=|<=)\s+([\d\.]+))?$/) {
44 next if exists($suppress{$1});
45 my @parts = split /::/, $1;
46 if (scalar @parts > 1) {
47 next if exists($suppress{$parts[0]});
51 print STDERR " $3 $4" if $4;
54 $mods{$1} = $4 ? $4 : undef;
61 package Bundle::$name;
63 \$VERSION = '$version';
71 Bundle::$name - A bundle to install prerequisites for the $name package
75 C<perl -MCPAN -e 'install Bundle::$name'>
84 This bundle includes all prerequisites needed by the $name package.
90 foreach (sort keys %mods) {
92 print " $mods{$_}" if exists($mods{$_}) && $mods{$_};