+=head2 C<intuit_license>
+
+Returns an array reference to a list of Gentoo licences identifiers under which the current distribution is released.
+
+=cut
+
+my %dslip_license = (
+ p => 'perl',
+ g => 'gpl',
+ l => 'lgpl',
+ b => 'bsd',
+ a => 'artistic',
+ 2 => 'artistic_2',
+);
+
+sub intuit_license {
+ my $self = shift;
+ my $mod = $self->parent;
+
+ my $dslip = $mod->dslip;
+ if (defined $dslip and $dslip =~ /\S{4}(\S)/) {
+ my @licenses = CPANPLUS::Dist::Gentoo::Maps::license_c2g($dslip_license{$1});
+ return \@licenses if @licenses;
+ }
+
+ my $extract_dir = $mod->status->extract;
+
+ for my $meta_file (qw/META.json META.yml/) {
+ my $meta = eval {
+ Parse::CPAN::Meta::LoadFile(File::Spec->catdir(
+ $extract_dir,
+ $meta_file,
+ ));
+ } or next;
+ my $license = $meta->{license};
+ if (defined $license) {
+ my @licenses = CPANPLUS::Dist::Gentoo::Maps::license_c2g($license);
+ return \@licenses if @licenses;
+ }
+ }
+
+ return [ CPANPLUS::Dist::Gentoo::Maps::license_c2g('perl') ];
+}
+