X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo%2FMaps.pm;h=3365a0f7c38222e845d092019176b09163cfb2ce;hp=d118edc2361f13cbb1e7cb94f2fc9d2396998830;hb=1c081d8b9a6c65ece91fa1363a4bdd9e49b00a37;hpb=7e2aca98057c17b7728aa3028a07dacd2fdd0d62 diff --git a/lib/CPANPLUS/Dist/Gentoo/Maps.pm b/lib/CPANPLUS/Dist/Gentoo/Maps.pm index d118edc..3365a0f 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Maps.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Maps.pm @@ -9,11 +9,11 @@ CPANPLUS::Dist::Gentoo::Maps - Map CPAN objects to Gentoo and vice versa. =head1 VERSION -Version 0.05 +Version 0.08 =cut -our $VERSION = '0.05'; +our $VERSION = '0.08'; =head1 DESCRPITON @@ -40,6 +40,61 @@ sub name_c2g { return $gentooisms{$name} || $name; } +=head2 C + +Maps F C tag values to the corresponding list of Gentoo licenses identifiers. +Duplicates are stripped off. + +The included data was gathered from L and L. + +=cut + +my %licenses = ( + apache => [ 'Apache-2.0' ], + artistic => [ 'Artistic' ], + artistic_2 => [ 'Artistic-2' ], + bsd => [ 'BSD' ], + gpl => [ 'GPL-1' ], + gpl2 => [ 'GPL-2' ], + gpl3 => [ 'GPL-3' ], + lgpl => [ 'LGPL-2.1' ], + lgpl2 => [ 'LGPL-2.1' ], + lgpl3 => [ 'LGPL-3' ], + mit => [ 'MIT' ], + mozilla => [ 'MPL-1.1' ], + perl => [ 'Artistic', 'GPL-2' ], +); + +sub license_c2g { + my %seen; + grep !$seen{$_}++, map @{$licenses{+lc} || []}, @_; +} + +=head2 C + +Converts a CPAN version to a Gentoo version. + +=cut + +sub version_c2g { + my ($v) = @_; + + return unless defined $v; + + $v =~ y/-/_/; + $v =~ y/0-9._//cd; + + $v =~ s/^[._]*//; + $v =~ s/[._]*$//; + $v =~ s/([._])[._]*/$1/g; + + ($v, my $patch, my @rest) = split /_/, $v; + $v .= '_p' . $patch if defined $patch; + $v .= join('.', '', @rest) if @rest; + + return $v; +} + =head1 SEE ALSO L. @@ -72,6 +127,7 @@ This program is free software; you can redistribute it and/or modify it under th __DATA__ ANSIColor Term-ANSIColor +AcePerl Ace Audio-CD Audio-CD-disc-cover CGI-Simple Cgi-Simple Cache-Mmap cache-mmap @@ -120,6 +176,7 @@ Locale-Maketext-Lexicon locale-maketext-lexicon Log-Dispatch log-dispatch Math-Pari math-pari Module-Info module-info +NTLM Authen-NTLM Net-Ping net-ping Net-SFTP net-sftp Net-SSH-Perl net-ssh-perl @@ -127,6 +184,7 @@ Net-Server net-server OLE-Storage_Lite OLE-StorageLite Ogg-Vorbis-Header ogg-vorbis-header PathTools File-Spec +Perl-Tidy perltidy Pod-Parser PodParser Regexp-Common regexp-common SDL_Perl sdl-perl