=head1 DESCRPITON
-This module is a CPANPLUS backend that recursively generates Gentoo ebuilds for a given package in the specified overlay (defaults to F</usr/local/portage>), updates the manifest, and even emerges it (together with its dependencies) if the user requires it. You need write permissions on the directory where Gentoo fetches its source files (usually F</usr/portage/distfiles>). You also need to specify the correct keyword for your architecture if it differs from the default C<x86>.
+This module is a CPANPLUS backend that recursively generates Gentoo ebuilds for a given package in the specified overlay (defaults to F</usr/local/portage>), updates the manifest, and even emerges it (together with its dependencies) if the user requires it. You need write permissions on the directory where Gentoo fetches its source files (usually F</usr/portage/distfiles>). The valid C<KEYWORDS> for the generated ebuilds are by default those given in C<ACCEPT_KEYWORDS>, but you can specify your own with the C<keywords> dist-option.
The generated ebuilds are placed into the C<perl-gcpanp> category. They favour depending on C<perl-core>, C<dev-perl> or C<perl-gcpan> (in that order) rather than C<perl-gcpanp>.
use constant CATEGORY => 'perl-gcpanp';
my $overlays;
+my $default_keywords;
sub format_available {
for my $prog (qw/emerge ebuild/) {
$o =~ s/["']*$//;
$overlays = [ map abs_path($_), grep length, split /:/, $o ];
}
+ if (/^ACCEPT_KEYWORDS=(.*)$/m) {
+ my $k = $1;
+ $k =~ s/^["']*//;
+ $k =~ s/["']*$//;
+ $default_keywords = [ split ' ', $k ];
+ }
}
} else {
error $errmsg;
}
}
+ $default_keywords = [ 'x86' ] unless defined $default_keywords;
+
return 1;
}
my $stat = $self->status;
my $conf = $self->parent->parent->configure_object;
- $stat->mk_accessors(qw/name version author distribution desc uri src license
+ $stat->mk_accessors(qw/name version author distribution desc uri license
deps eb_name eb_version eb_dir eb_file fetched_arch
portdir_overlay
overlay distdir keywords do_manifest header footer
$stat->prepared(0);
my $keywords = delete $opts{'keywords'};
- $keywords = 'x86' unless defined $keywords;
- $keywords = [ split ' ', $keywords ];
+ if (defined $keywords) {
+ $keywords = [ split ' ', $keywords ];
+ } else {
+ $keywords = $default_keywords;
+ }
$stat->keywords($keywords);
my $manifest = delete $opts{'manifest'};
$stat->uri('http://search.cpan.org/dist/' . $name);
- unless ($author =~ /^(.)(.)/) {
- error 'Wrong author name -- aborting';
- return 0;
- }
- $stat->src("mirror://cpan/modules/by-authors/id/$1/$1$2/$author/"
- . $mod->package);
-
$stat->license([ qw/Artistic GPL-2/ ]);
my $prereqs = $mod->status->prereqs;
my $d = $stat->header;
$d .= "# Generated by CPANPLUS::Dist::Gentoo version $VERSION\n\n";
$d .= 'MODULE_AUTHOR="' . $stat->author . "\"\ninherit perl-module\n\n";
- $d .= 'S="${WORKDIR}/' . $stat->distribution . "\"\n";
$d .= 'DESCRIPTION="' . $stat->desc . "\"\n";
- $d .= 'HOMEPAGE="' . $stat->uri . "\"\n";
- $d .= 'SRC_URI="' . $stat->src . "\"\n";
+ $d .= 'HOMEPAGE="' . $stat->uri . "\"\n\n";
$d .= "SLOT=\"0\"\n";
$d .= 'LICENSE="|| ( ' . join(' ', sort @{$stat->license}) . " )\"\n";
$d .= 'KEYWORDS="' . join(' ', sort @{$stat->keywords}) . "\"\n";