support/script/cpan: improve Makefile generation
- remove trailing space after perl when it's the only dependency - license: substitution of perl name by BR name - add a tabulation before source Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
parent
7cf527426f
commit
6b8376d8f0
|
@ -598,14 +598,17 @@ while (my ($distname, $dist) = each %dist) {
|
||||||
# the scheme is not used, because the job is done by the BR download infrastructure
|
# the scheme is not used, because the job is done by the BR download infrastructure
|
||||||
# the auth part is not used, because we use $(BR2_CPAN_MIRROR)
|
# the auth part is not used, because we use $(BR2_CPAN_MIRROR)
|
||||||
my($filename, $directories, $suffix) = fileparse( $path, q{tar.gz}, q{tgz} );
|
my($filename, $directories, $suffix) = fileparse( $path, q{tar.gz}, q{tgz} );
|
||||||
my $dependencies = join q{ }, map( { q{host-} . fsname( $_ ); } sort @{$deps_build{$distname}} ),
|
my $dependencies = join q{ }, qw( perl ),
|
||||||
|
map( { q{host-} . fsname( $_ ); } sort @{$deps_build{$distname}} ),
|
||||||
map( { fsname( $_ ); } sort @{$deps_runtime{$distname}} );
|
map( { fsname( $_ ); } sort @{$deps_runtime{$distname}} );
|
||||||
my $host_dependencies = join q{ }, map { q{host-} . fsname( $_ ); } sort( @{$deps_build{$distname}},
|
my $host_dependencies = join q{ }, map { q{host-} . fsname( $_ ); } sort( @{$deps_build{$distname}},
|
||||||
@{$deps_runtime{$distname}} );
|
@{$deps_runtime{$distname}} );
|
||||||
my $license = ref $dist->{license} eq 'ARRAY'
|
my $license = ref $dist->{license} eq 'ARRAY'
|
||||||
? join q{ or }, @{$dist->{license}}
|
? join q{ or }, @{$dist->{license}}
|
||||||
: $dist->{license};
|
: $dist->{license};
|
||||||
$license = q{Artistic or GPLv1+} if $license eq q{perl_5};
|
$license =~ s|artistic_2|Artistic-2.0|;
|
||||||
|
$license =~ s|openssl|OpenSSL|;
|
||||||
|
$license =~ s|perl_5|Artistic or GPLv1+|;
|
||||||
say qq{write ${mkname}} unless $quiet;
|
say qq{write ${mkname}} unless $quiet;
|
||||||
open my $fh, q{>}, $mkname;
|
open my $fh, q{>}, $mkname;
|
||||||
say {$fh} qq{################################################################################};
|
say {$fh} qq{################################################################################};
|
||||||
|
@ -617,7 +620,7 @@ while (my ($distname, $dist) = each %dist) {
|
||||||
say {$fh} qq{${brname}_VERSION = ${version}};
|
say {$fh} qq{${brname}_VERSION = ${version}};
|
||||||
say {$fh} qq{${brname}_SOURCE = ${distname}-\$(${brname}_VERSION).${suffix}};
|
say {$fh} qq{${brname}_SOURCE = ${distname}-\$(${brname}_VERSION).${suffix}};
|
||||||
say {$fh} qq{${brname}_SITE = \$(BR2_CPAN_MIRROR)${directories}};
|
say {$fh} qq{${brname}_SITE = \$(BR2_CPAN_MIRROR)${directories}};
|
||||||
say {$fh} qq{${brname}_DEPENDENCIES = perl ${dependencies}} if $need_target{$distname};
|
say {$fh} qq{${brname}_DEPENDENCIES = ${dependencies}} if $need_target{$distname};
|
||||||
say {$fh} qq{HOST_${brname}_DEPENDENCIES = ${host_dependencies}} if $need_host{$distname};
|
say {$fh} qq{HOST_${brname}_DEPENDENCIES = ${host_dependencies}} if $need_host{$distname};
|
||||||
say {$fh} qq{${brname}_LICENSE = ${license}} if $license && $license ne q{unknown};
|
say {$fh} qq{${brname}_LICENSE = ${license}} if $license && $license ne q{unknown};
|
||||||
say {$fh} qq{};
|
say {$fh} qq{};
|
||||||
|
@ -640,7 +643,7 @@ if (-f $cfgname) {
|
||||||
|
|
||||||
foreach my $distname (keys %need_target) {
|
foreach my $distname (keys %need_target) {
|
||||||
my $fsname = fsname( $distname );
|
my $fsname = fsname( $distname );
|
||||||
$pkg{qq{source "package/${fsname}/Config.in"}} = 1;
|
$pkg{qq{\tsource "package/${fsname}/Config.in"}} = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
say qq{${cfgname} must contain the following lines:};
|
say qq{${cfgname} must contain the following lines:};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user