Codebase list libmodule-install-perl / fresh-releases/main
New upstream release. Debian Janitor 1 year, 19 days ago
43 changed file(s) with 55 addition(s) and 362 deletion(s). Raw diff Collapse all Expand all
+0
-27
.travis.yml less more
0 language: perl
1 perl:
2 - blead # builds perl from git
3 - dev # latest point release
4 - '5.26'
5 - '5.24'
6 - '5.22'
7 - '5.20'
8 - '5.18'
9 - '5.16'
10 - '5.14'
11 - '5.12'
12 - '5.10'
13 - '5.8'
14 before_install:
15 - git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
16 - source ~/travis-perl-helpers/init
17 - build-perl
18 - perl -V
19 - build-dist
20 - cd $BUILD_DIR
21 install:
22 - cpan-install YAML::Tiny File::Remove Module::Build Module::ScanDeps Parse::CPAN::Meta
23 script:
24 - perl Makefile.PL
25 - make
26 - prove -b -r -s -j1 $(test-files)
00 Changes for Perl programming language extension Module-Install
1
2 1.21 2023-04-28
3 - fix tests broken by Module::Install::DSL removal
4
5 1.20 2023-04-27
6 - Module::Install::DSL has been removed, as its use is highly discouraged.
17
28 1.19 2017-12-19
39 - remove use of INIT phase in Module::Install::DSL, to fix issues on perl
00 .ackrc
11 .mailmap
2 .travis.yml
32 Changes
43 lib/inc/Module/Install.pm
5 lib/inc/Module/Install/DSL.pm
64 lib/Module/AutoInstall.pm
75 lib/Module/Install.pm
86 lib/Module/Install.pod
2321 lib/Module/Install/Can.pm
2422 lib/Module/Install/Compiler.pm
2523 lib/Module/Install/Deprecated.pm
26 lib/Module/Install/DSL.pm
2724 lib/Module/Install/External.pm
2825 lib/Module/Install/FAQ.pod
2926 lib/Module/Install/Fetch.pm
5249 t/05_share.t
5350 t/06_ppport.t
5451 t/07_perl_version.t
55 t/08_dsl.t
5652 t/09_read.t
5753 t/10_test.t
5854 t/11_extraction.t
1111 YAML::Tiny: '1.33'
1212 distribution_type: module
1313 dynamic_config: 0
14 generated_by: 'Module::Install version 1.19'
14 generated_by: 'Module::Install version 1.21'
1515 license: perl
1616 meta-spec:
1717 url: http://module-build.sourceforge.net/META-spec-v1.4.html
4646 resources:
4747 license: http://dev.perl.org/licenses/
4848 repository: https://github.com/Perl-Toolchain-Gang/Module-Install.git
49 version: '1.19'
49 version: '1.21'
5050 x_contributors:
5151 - 'Adam Kennedy <adam@ali.as>'
5252 - 'Kenichi Ishigaki <ishigaki@cpan.org>'
0 libmodule-install-perl (1.21-1) UNRELEASED; urgency=low
1
2 * New upstream release.
3
4 -- Debian Janitor <janitor@jelmer.uk> Tue, 02 May 2023 01:51:57 -0000
5
06 libmodule-install-perl (1.19-2) unstable; urgency=medium
17
28 [ Salvatore Bonaccorso ]
66
77 use vars qw{$VERSION};
88 BEGIN {
9 $VERSION = '1.19';
9 $VERSION = '1.21';
1010 }
1111
1212 # special map on pre-defined feature sets
44
55 use vars qw{$VERSION @ISA};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = qw{Module::Install::Base};
99 }
1010
66
77 use vars qw{$VERSION @ISA};
88 BEGIN {
9 $VERSION = '1.19';
9 $VERSION = '1.21';
1010 @ISA = qw{Module::Install::Base};
1111 }
1212
44 use Module::Install::Base ();
55 use vars qw{$VERSION @ISA};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = qw(Module::Install::Base);
99 }
1010
44
55 use vars qw{$VERSION @ISA};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = qw{Module::Install::Base};
99 }
1010
55
66 use vars qw{$VERSION @ISA};
77 BEGIN {
8 $VERSION = '1.19';
8 $VERSION = '1.21';
99 @ISA = qw{Module::Install::Base};
1010 }
1111
44
55 use vars qw{$VERSION @ISA};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = qw{Module::Install::Base};
99 }
1010
55
66 use vars qw{$VERSION @ISA};
77 BEGIN {
8 $VERSION = '1.19';
8 $VERSION = '1.21';
99 @ISA = 'Module::Install::Base';
1010 }
1111
33 use Module::Install::Base ();
44 use vars qw{$VERSION @ISA};
55 BEGIN {
6 $VERSION = '1.19';
6 $VERSION = '1.21';
77 @ISA = qw(Module::Install::Base);
88 }
99
44
55 use vars qw{$VERSION @ISA};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = qw{Module::Install::Base};
99 }
1010
55
66 use vars qw{$VERSION @ISA};
77 BEGIN {
8 $VERSION = '1.19';
8 $VERSION = '1.21';
99 @ISA = 'Module::Install';
1010 }
1111
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = 'Module::Install::Base';
99 $ISCORE = 1;
1010 }
22 use strict 'vars';
33 use vars qw{$VERSION};
44 BEGIN {
5 $VERSION = '1.19';
5 $VERSION = '1.21';
66 }
77
88 # Suspend handler for "redefined" warnings
55
66 use vars qw{$VERSION @ISA $ISCORE};
77 BEGIN {
8 $VERSION = '1.19';
8 $VERSION = '1.21';
99 @ISA = 'Module::Install::Base';
1010 $ISCORE = 1;
1111 }
66
77 use vars qw{$VERSION @ISA $ISCORE};
88 BEGIN {
9 $VERSION = '1.19';
9 $VERSION = '1.21';
1010 @ISA = 'Module::Install::Base';
1111 $ISCORE = 1;
1212 }
55
66 use vars qw{$VERSION @ISA $ISCORE};
77 BEGIN {
8 $VERSION = '1.19';
8 $VERSION = '1.21';
99 @ISA = 'Module::Install::Base';
1010 $ISCORE = 1;
1111 }
+0
-101
lib/Module/Install/DSL.pm less more
0 package Module::Install::DSL;
1
2 use strict;
3 use vars qw{$VERSION $ISCORE};
4 BEGIN {
5 $VERSION = '1.19';
6 $ISCORE = 1;
7 *inc::Module::Install::DSL::VERSION = *VERSION;
8 @inc::Module::Install::DSL::ISA = __PACKAGE__;
9 }
10
11 sub import {
12 # Read in the rest of the Makefile.PL
13 open 0 or die "Couldn't open $0: $!";
14 my $dsl;
15 SCOPE: {
16 local $/ = undef;
17 $dsl = join "", <0>;
18 }
19
20 # Change inc::Module::Install::DSL to the regular one.
21 # Remove anything before the use inc::... line.
22 $dsl =~ s/.*?^\s*use\s+(?:inc::)?Module::Install::DSL(\b[^;]*);\s*\n//sm;
23
24 # Load inc::Module::Install as we would in a regular Makefile.Pl
25 SCOPE: {
26 package main;
27 require inc::Module::Install;
28 inc::Module::Install->import;
29 }
30
31 # Add the ::DSL plugin to the list of packages in /inc
32 my $admin = $Module::Install::MAIN->{admin};
33 if ( $admin ) {
34 my $from = $INC{"$admin->{path}/DSL.pm"};
35 my $to = "$admin->{base}/$admin->{prefix}/$admin->{path}/DSL.pm";
36 $admin->copy( $from => $to );
37 }
38
39 # Convert the basic syntax to code
40 my $code = "{\n"
41 . "package main;\n\n"
42 . dsl2code($dsl)
43 . "\n\nWriteAll();\n"
44 . "}\n";
45
46 # Execute the script
47 eval $code;
48 print STDERR "Failed to execute the generated code...\n$@" if $@;
49
50 exit(0);
51 }
52
53 sub dsl2code {
54 my $dsl = shift;
55
56 # Split into lines and strip blanks
57 my @lines = grep { /\S/ } split /[\012\015]+/, $dsl;
58
59 # Each line represents one command
60 my @code = ();
61 my $static = 1;
62 foreach my $line ( @lines ) {
63 # Split the lines into tokens
64 my @tokens = split /\s+/, $line;
65
66 # The first word is the command
67 my $command = shift @tokens;
68 my @params = ();
69 my @suffix = ();
70 while ( @tokens ) {
71 my $token = shift @tokens;
72 if ( $token eq 'if' or $token eq 'unless' ) {
73 # This is the beginning of a suffix
74 push @suffix, $token;
75 push @suffix, @tokens;
76
77 # The conditional means this distribution
78 # can no longer be considered fully static.
79 $static = 0;
80 last;
81 } else {
82 # Convert to a string
83 $token =~ s/([\\\'])/\\$1/g;
84 push @params, "'$token'";
85 }
86 };
87
88 # Merge to create the final line of code
89 @tokens = ( $command, @params ? join( ', ', @params ) : (), @suffix );
90 push @code, join( ' ', @tokens ) . ";\n";
91 }
92
93 # Is our configuration static?
94 push @code, "static_config;\n" if $static;
95
96 # Join into the complete code block
97 return join( '', @code );
98 }
99
100 1;
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = 'Module::Install::Base';
99 $ISCORE = 1;
1010 }
66
77 use vars qw{$VERSION $ISCORE @ISA};
88 BEGIN {
9 $VERSION = '1.19';
9 $VERSION = '1.21';
1010 $ISCORE = 1;
1111 @ISA = qw{Module::Install::Base};
1212 }
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = 'Module::Install::Base';
99 $ISCORE = 1;
1010 }
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = 'Module::Install::Base';
99 $ISCORE = 1;
1010 }
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = 'Module::Install::Base';
99 $ISCORE = 1;
1010 }
55
66 use vars qw{$VERSION @ISA $ISCORE};
77 BEGIN {
8 $VERSION = '1.19';
8 $VERSION = '1.21';
99 @ISA = 'Module::Install::Base';
1010 $ISCORE = 1;
1111 }
66
77 use vars qw{$VERSION @ISA $ISCORE};
88 BEGIN {
9 $VERSION = '1.19';
9 $VERSION = '1.21';
1010 @ISA = 'Module::Install::Base';
1111 $ISCORE = 1;
1212 }
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = 'Module::Install::Base';
99 $ISCORE = 1;
1010 }
453453 my %license_urls = (
454454 perl => 'http://dev.perl.org/licenses/',
455455 apache => 'http://apache.org/licenses/LICENSE-2.0',
456 apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1',
457456 artistic => 'http://opensource.org/licenses/artistic-license.php',
458 artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
459457 lgpl => 'http://opensource.org/licenses/lgpl-license.php',
460 lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
461 lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
462458 bsd => 'http://opensource.org/licenses/bsd-license.php',
463459 gpl => 'http://opensource.org/licenses/gpl-license.php',
464460 gpl2 => 'http://opensource.org/licenses/gpl-2.0.php',
469465 unrestricted => undef,
470466 restrictive => undef,
471467 unknown => undef,
468
469 # these are not actually allowed in meta-spec v1.4 but are left here for compatibility:
470 apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1',
471 artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
472 lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
473 lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
472474 );
473475
474476 sub license {
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = 'Module::Install::Base';
99 $ISCORE = 1;
1010 }
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = 'Module::Install::Base';
99 $ISCORE = 1;
1010 }
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = 'Module::Install::Base';
99 $ISCORE = 1;
1010 }
66
77 use vars qw{$VERSION @ISA $ISCORE};
88 BEGIN {
9 $VERSION = '1.19';
9 $VERSION = '1.21';
1010 @ISA = 'Module::Install::Base';
1111 $ISCORE = 1;
1212 }
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = 'Module::Install::Base';
99 $ISCORE = 1;
1010 }
66
77 use vars qw{$VERSION @ISA $ISCORE};
88 BEGIN {
9 $VERSION = '1.19';
9 $VERSION = '1.21';
1010 @ISA = 'Module::Install::Base';
1111 $ISCORE = 1;
1212 }
44
55 use vars qw{$VERSION @ISA $ISCORE};
66 BEGIN {
7 $VERSION = '1.19';
7 $VERSION = '1.21';
88 @ISA = qw{Module::Install::Base};
99 $ISCORE = 1;
1010 }
2929 # This is not enforced yet, but will be some time in the next few
3030 # releases once we can make sure it won't clash with custom
3131 # Module::Install extensions.
32 $VERSION = '1.19';
32 $VERSION = '1.21';
3333
3434 # Storage for the pseudo-singleton
3535 $MAIN = undef;
+0
-108
lib/inc/Module/Install/DSL.pm less more
0 package inc::Module::Install::DSL;
1
2 # This module ONLY loads if the user has manually installed their own
3 # installation of Module::Install, and are some form of MI author.
4 #
5 # It runs from the installed location, and is never bundled
6 # along with the other bundled modules.
7 #
8 # So because the version of this differs from the version that will
9 # be bundled almost every time, it doesn't have it's own version and
10 # isn't part of the synchronisation-checking.
11
12 use strict;
13 use vars qw{$VERSION};
14 BEGIN {
15 # While this version will be overwritten when Module::Install
16 # loads, it remains so Module::Install itself can detect which
17 # version an author currently has installed.
18 # This allows it to implement any back-compatibility features
19 # it may want or need to.
20 $VERSION = '1.19';
21 }
22
23 if ( -d './inc' ) {
24 my $author = $^O eq 'VMS' ? './inc/_author' : './inc/.author';
25 if ( -d $author ) {
26 $Module::Install::AUTHOR = 1;
27 require File::Path;
28 File::Path::rmtree('inc');
29 }
30 } else {
31 $Module::Install::AUTHOR = 1;
32 }
33
34 unshift @INC, 'inc' unless $INC[0] eq 'inc';
35 require inc::Module::Install;
36 require Module::Install::DSL;
37
38 # Tie our import to the main one
39 sub import {
40 goto &Module::Install::DSL::import;
41 }
42
43 1;
44
45 =pod
46
47 =head1 NAME
48
49 inc::Module::Install::DSL - Domain Specific Language for Module::Install
50
51 =head1 SYNOPSIS
52
53 use inc::Module::Install::DSL 0.80;
54
55 all_from lib/ADAMK/Repository.pm
56 requires File::Spec 3.29
57 requires File::pushd 1.00
58 requires File::Find::Rule 0.30
59 requires File::Find::Rule::VCS 1.05
60 requires File::Flat 0
61 requires File::Remove 1.42
62 requires IPC::Run3 0.034
63 requires Object::Tiny 1.06
64 requires Params::Util 0.35
65 requires CPAN::Version 5.5
66 test_requires Test::More 0.86
67 test_requires Test::Deep 1.03
68 install_script adamk
69
70 requires_external_bin svn
71
72 =head1 DESCRIPTION
73
74 One of the primary design goals of L<Module::Install> is to simplify
75 the creation of F<Makefile.PL> scripts.
76
77 Part of this involves the gradual reduction of any and all superfluous
78 characters, with the ultimate goal of requiring no non-critical
79 information in the file.
80
81 L<Module::Install::DSL> is a simple B<Domain Specific Language> based
82 on the already-lightweight L<Module::Install> command syntax.
83
84 The DSL takes one command on each line, and then wraps the command
85 (and its parameters) with the normal quotes and semi-colons etc to
86 turn it into Perl code.
87
88 =head1 SUPPORT
89
90 Bugs should be reported via the CPAN bug tracker at
91
92 L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Module-Install>
93
94 For other issues contact the author.
95
96 =head1 AUTHORS
97
98 Adam Kennedy E<lt>adamk@cpan.orgE<gt>
99
100 =head1 COPYRIGHT
101
102 Copyright 2008 - 2012 Adam Kennedy.
103
104 This program is free software; you can redistribute it and/or
105 modify it under the same terms as Perl itself.
106
107 =cut
1717 # version an author currently has installed.
1818 # This allows it to implement any back-compatibility features
1919 # it may want or need to.
20 $VERSION = '1.19';
20 $VERSION = '1.21';
2121 }
2222
2323 if ( -d './inc' ) {
55 $^W = 1;
66 }
77
8 use Test::More tests => 68;
8 use Test::More tests => 66;
99
1010 # Check their perl version
1111 ok( $] >= 5.005, "Your perl is new enough" );
2222 Module::Install::Can
2323 Module::Install::Compiler
2424 Module::Install::Deprecated
25 Module::Install::DSL
2625 Module::Install::External
2726 Module::Install::Fetch
2827 Module::Install::Include
+0
-80
t/08_dsl.t less more
0 # Tests for Module::Install::DSL
1
2 use strict;
3 BEGIN {
4 $| = 1;
5 $^W = 1;
6 }
7
8 use Test::More tests => 8;
9 use lib 't/lib';
10 use MyTest;
11
12 # Load the DSL module
13 require_ok( 'inc::Module::Install::DSL' );
14
15 # Generate code from a simple dsl block
16 my $code = Module::Install::DSL::dsl2code(<<'END_DSL');
17 all_from lib/My/Module.pm
18 requires perl 5.008
19 requires Carp 0
20 requires Win32 if win32
21 test_requires Test::More
22 install_share
23 END_DSL
24
25 is( $code, <<'END_PERL', 'dsl2code generates the expected code' );
26 all_from 'lib/My/Module.pm';
27 requires 'perl', '5.008';
28 requires 'Carp', '0';
29 requires 'Win32' if win32;
30 test_requires 'Test::More';
31 install_share;
32 END_PERL
33
34
35
36
37
38 ######################################################################
39 # Automatic dynamic vs static detection
40
41 # Automatically set static_config if there are no conditionals
42 my $static = Module::Install::DSL::dsl2code(<<'END_DSL');
43 all_from lib/My/Module.pm
44 requires perl 5.008
45 requires Carp 0
46 requires Win32
47 test_requires Test::More
48 install_share
49 END_DSL
50
51 is( $static, <<'END_PERL', 'dsl2code generates the expected code' );
52 all_from 'lib/My/Module.pm';
53 requires 'perl', '5.008';
54 requires 'Carp', '0';
55 requires 'Win32';
56 test_requires 'Test::More';
57 install_share;
58 static_config;
59 END_PERL
60
61
62
63
64
65 #####################################################################
66 # Full scan dist run
67
68 ok( create_dist( 'Foo', { 'Makefile.PL' => <<"END_DSL" }), 'create_dist' );
69 use inc::Module::Install::DSL 0.81;
70 name Foo
71 version 0.01
72 license perl
73 requires_from lib/Foo.pm
74 requires File::Spec 0.79
75 END_DSL
76 ok( build_dist(), 'build_dist' );
77 ok( -f makefile() );
78 ok( -f file('META.yml') );
79 ok( kill_dist(), 'kill_dist' );
88
99 use vars qw{$VERSION @ISA @EXPORT $DIST};
1010 BEGIN {
11 $VERSION = '1.19';
11 $VERSION = '1.21';
1212 @ISA = 'Exporter';
1313 @EXPORT = qw{
1414 create_dist