diff -ru cpan2rpm-2.022-orig/cpan2rpm cpan2rpm-2.022/cpan2rpm --- cpan2rpm-2.022-orig/cpan2rpm 2004-02-03 16:53:52.000000000 -0600 +++ cpan2rpm-2.022/cpan2rpm 2004-02-03 16:54:29.000000000 -0600 @@ -398,8 +398,8 @@ chdir $info{evaldir} || die "get_meta(): $!"; - local $_ = "$info{evaldir}/Makefile.PL"; - $_ = "$info{evaldir}/Build.PL" unless -e; + local $_ = "$info{evaldir}/Build.PL"; + $_ = "$info{evaldir}/Makefile.PL" unless -e; die qq/No PL file in tarball/ unless -e; die qq/Cannot read PL file/ unless -r; @@ -423,8 +423,15 @@ # we already own it and have hijacked the appropriate method my $PLMOD = "ExtUtils::MakeMaker"; - $PLMOD = "Module::Build" if $info{PL} =~ /^Build/; - $@ = ""; eval "use $PLMOD"; die "$PLMOD unloadable" if $@; + if ($info{PL} =~ /^Build/) { + $PLMOD = "Module::Build"; + # We don't have $info{name} yet, so we'll have to use the tarball name + if ($info{tarball} =~ /^Module-Build/) { + # Module::Build builds itself using itself + unshift @INC, 'lib'; + } + } + $@ = ""; eval "use $PLMOD"; die "$PLMOD unloadable: $@" if $@; # grab parameters to function e.g. WriteMakefile()