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