1: This patch allows you to use dh-make-perl (Debian's Perl module packager) with
   2: CPANPLUS instead of CPAN.pm. Use --cpanplus instead of --cpan.
   3: 
   4: And no, this isn't a coding style that I like, but I thought it would be best
   5: to use the style that the dh-make-perl script already had.
   6: 
   7: Sigh. Stupid line numbering, never heard of <ol>/<li> - some browsers can
   8: actually ignore the numbers then... :)
   9: Use "d/l code" below.
  10: 
  11: --- dh-make-perl	Sun Nov 11 20:05:55 2001
  12: +++ /usr/bin/dh-make-perl	Mon Apr 15 17:06:42 2002
  13: @@ -71,7 +71,6 @@
  14:  use File::Basename;
  15:  use File::Find;
  16:  use User::pwent;
  17: -use CPAN;
  18:  use Getopt::Long;
  19:  use Cwd;
  20:  use strict;
  21: @@ -94,13 +93,14 @@
  22:  my ($pkgname, $srcname, $version, $desc, $longdesc, $copyright, $author);
  23:  my ($extrasfields, $extrapfields);
  24:  my (@docs, $changelog, @args);
  25: -my ($cpanmodule, $build, $install, $dbflags);
  26: +my ($cpanmodule, $cpanplusmodule, $build, $install, $dbflags);
  27:  
  28:  $dbflags = $>==0?"":"-rfakeroot";
  29:  chomp($date);
  30:  
  31:  GetOptions(
  32:  	"cpan=s" => \$cpanmodule,
  33: +	"cpanplus=s" => \$cpanplusmodule,
  34:  	"desc=s" => \$desc,
  35:  	"arch=s" => \$arch,
  36:  	"version=s" => \$version,
  37: @@ -111,7 +111,7 @@
  38:  	"install!" => \$install,
  39:  	) || die <<"USAGE";
  40:  Usage:
  41: -$0 [--build] [--install] [module_source_dir|--cpan modulename]
  42: +$0 [--build] [--install] [module_source_dir|--cpan modulename|--cpanplus modulename]
  43:  Other options: [--desc description] [--arch arch] [--version pkg_version]
  44:  USAGE
  45:  
  46: @@ -149,6 +149,7 @@
  47:  
  48:  sub setup_dir {
  49:  	if ($cpanmodule) {
  50: +		require CPAN;
  51:  		my ($dist, $mod, $cpanversion);
  52:  		$mod = CPAN::Shell->expand('Module', '/^'.$cpanmodule.'$/') 
  53:  			|| die "Can't find '$cpanmodule' module on CPAN\n";
  54: @@ -164,6 +165,13 @@
  55:  			$dist->get || die "Cannot get ", $mod->cpan_file, "\n";
  56:  			$maindir = $dist->dir;
  57:  		}
  58: +	} elsif ($cpanplusmodule) {
  59: +		require CPANPLUS;
  60: +		my $cb = CPANPLUS::Backend->new();
  61: +		my $href = $cb->fetch( modules => [ $cpanplusmodule ] );
  62: +		die "Cannot get $cpanplusmodule\n" if keys(%$href) != 1;
  63: +		my $file = (values %$href)[0];
  64: +		$maindir = $cb->extract( files => [ $file ] )->{$file};
  65:  	} else {
  66: 
  67:  		$maindir = shift(@ARGV) || '.';
  68:  	}
  69: @@ -243,6 +251,7 @@
  70:  	# band aid: need to find a solution also for build in directories
  71:  	# warn "name is $name (cpan name: $cpanmodule)\n";
  72:  	$name = $cpanmodule if ($name eq '__PACKAGE__' && $cpanmodule);
  73: +	$name = $cpanplusmodule if ($name eq '__PACKAGE__' && $cpanplusmodule);
  74:  	for (($name, $ver)) {
  75:  		next unless defined;
  76:  		next unless /^\$/;
  77: @@ -484,7 +493,7 @@
  78:  
  79:  =head1 SYNOPSIS
  80:  
  81: -dh-make-perl [module_source_dir|--cpan module]
  82: +dh-make-perl [module_source_dir|--cpan module|--cpanplus module]
  83:  
  84:  Additional options include:
  85: