]> git.vpit.fr Git - perl/modules/CPANPLUS-Dist-Gentoo.git/blobdiff - lib/CPANPLUS/Dist/Gentoo.pm
The dists available in cpan/modules/by-module are only those registered in the module...
[perl/modules/CPANPLUS-Dist-Gentoo.git] / lib / CPANPLUS / Dist / Gentoo.pm
index e5c40fb979a59ba935d60050dc8b38caa01e54a2..2e876336ac6045552c7ce42005f3153042631790 100644 (file)
@@ -67,7 +67,7 @@ sub init {
  my $stat = $self->status;
  my $conf = $self->parent->parent->configure_object;
 
- $stat->mk_accessors(qw/name version dist desc uri src license deps
+ $stat->mk_accessors(qw/name version author dist desc uri src license deps
                         eb_name eb_version eb_dir eb_file fetched_arch
                         overlay distdir keywords do_manifest
                         force verbose/);
@@ -123,6 +123,9 @@ sub prepare {
  my $version = $mod->package_version;
  $stat->version($version);
 
+ my $author = $mod->author->cpanid;
+ $stat->author($author);
+
  $stat->dist($name . '-' . $version);
 
  $version =~ s/[^\d._]+//g;
@@ -170,11 +173,12 @@ sub prepare {
 
  $stat->uri('http://search.cpan.org/dist/' . $name);
 
- unless ($name =~ /^([^-]+)/) {
-  error 'Wrong distribution name -- aborting';
+ unless ($author =~ /^(.)(.)/) {
+  error 'Wrong author name -- aborting';
   return 0;
  }
- $stat->src('mirror://cpan/modules/by-module/' . $1 . '/' . $mod->package);
+ $stat->src("mirror://cpan/modules/by-authors/id/$1/$1$2/$author/"
+            . $mod->package);
 
  $stat->license([ qw/Artistic GPL-2/ ]);
 
@@ -231,7 +235,8 @@ sub create {
   }
  }
 
- my $d = "# Generated by CPANPLUS::Dist::Gentoo\n\ninherit perl-module\n\n";
+ my $d = "# Generated by CPANPLUS::Dist::Gentoo\n\n";
+ $d   .= 'MODULE_AUTHOR="' . $stat->author . "\"\ninherit perl-module\n\n";
  $d   .= 'S="${WORKDIR}/' . $stat->dist . "\"\n";
  $d   .= 'DESCRIPTION="' . $stat->desc . "\"\n";
  $d   .= 'HOMEPAGE="' . $stat->uri . "\"\n";
@@ -253,6 +258,7 @@ sub create {
            . ' )';
   } @{$stat->deps};
  $d   .= "\"\n";
+ $d   .= "SRC_TEST=\"do\"\n";
 
  my $file = $stat->eb_file;
  open my $eb, '>', $file or do {