New Upstream Release - libdist-zilla-plugin-modulebuildtiny-perl

Ready changes

Summary

Merged new upstream version: 0.016 (was: 0.015).

Resulting package

Built on 2023-05-03T13:11 (took 12m7s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-releases libdist-zilla-plugin-modulebuildtiny-perl

Lintian Result

Diff

diff --git a/Build.PL b/Build.PL
index 9e8d116..588b7ef 100644
--- a/Build.PL
+++ b/Build.PL
@@ -5,3 +5,4 @@ use warnings;
 use 5.006;
 use Module::Build::Tiny 0.034;
 Build_PL();
+
diff --git a/Changes b/Changes
index 8892343..72eeb86 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for Dist-Zilla-Plugin-ModuleBuildTiny
 
+0.016     2023-04-28 15:51:16+02:00 Europe/Brussels
+          - Add header and footer attributes
+          - Add configure dependency on MBT version 0.044 if include/ or src/
+
 0.015     2016-06-09 19:28:18+02:00 Europe/Amsterdam
           Adapted to dzil v6
 
diff --git a/INSTALL b/INSTALL
index 3c613da..2287d65 100644
--- a/INSTALL
+++ b/INSTALL
@@ -8,10 +8,10 @@ If you have cpanm, you only need one line:
 
     % cpanm Dist::Zilla::Plugin::ModuleBuildTiny
 
-If you are installing into a system-wide directory, you may need to pass the
-"-S" flag to cpanm, which uses sudo to install the module:
-
-    % cpanm -S Dist::Zilla::Plugin::ModuleBuildTiny
+If it does not have permission to install modules to the current perl, cpanm
+will automatically set up and install to a local::lib in your home directory.
+See the local::lib documentation (https://metacpan.org/pod/local::lib) for
+details on enabling it in your environment.
 
 ## Installing with the CPAN shell
 
@@ -21,8 +21,11 @@ Alternatively, if your CPAN shell is set up, you should just be able to do:
 
 ## Manual installation
 
-As a last resort, you can manually install it. Download the tarball, untar it,
-then build it:
+As a last resort, you can manually install it. If you have not already
+downloaded the release tarball, you can find the download link on the module's
+MetaCPAN page: https://metacpan.org/pod/Dist::Zilla::Plugin::ModuleBuildTiny
+
+Untar the tarball, install configure prerequisites (see below), then build it:
 
     % perl Build.PL
     % ./Build && ./Build test
@@ -31,13 +34,47 @@ Then install it:
 
     % ./Build install
 
-If you are installing into a system-wide directory, you may need to run:
+Or the more portable variation:
+
+    % perl Build.PL
+    % perl Build
+    % perl Build test
+    % perl Build install
+
+If your perl is system-managed, you can create a local::lib in your home
+directory to install modules to. For details, see the local::lib documentation:
+https://metacpan.org/pod/local::lib
+
+The prerequisites of this distribution will also have to be installed manually. The
+prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated
+by running the manual build process described above.
 
-    % sudo ./Build install
+## Configure Prerequisites
+
+This distribution requires other modules to be installed before this
+distribution's installer can be run.  They can be found under the
+"configure_requires" key of META.yml or the
+"{prereqs}{configure}{requires}" key of META.json.
+
+## Other Prerequisites
+
+This distribution may require additional modules to be installed after running
+Build.PL.
+Look for prerequisites in the following phases:
+
+* to run ./Build, PHASE = build
+* to use the module code itself, PHASE = runtime
+* to run tests, PHASE = test
+
+They can all be found in the "PHASE_requires" key of MYMETA.yml or the
+"{prereqs}{PHASE}{requires}" key of MYMETA.json.
 
 ## Documentation
 
 Dist-Zilla-Plugin-ModuleBuildTiny documentation is available as POD.
-You can run perldoc from a shell to read the documentation:
+You can run `perldoc` from a shell to read the documentation:
 
     % perldoc Dist::Zilla::Plugin::ModuleBuildTiny
+
+For more information on installing Perl modules via CPAN, please see:
+https://www.cpan.org/modules/INSTALL.html
diff --git a/LICENSE b/LICENSE
index 559ccf3..7504f4a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -292,21 +292,21 @@ Definitions:
 
   - "Package" refers to the collection of files distributed by the Copyright
     Holder, and derivatives of that collection of files created through
-    textual modification. 
+    textual modification.
   - "Standard Version" refers to such a Package if it has not been modified,
     or has been modified in accordance with the wishes of the Copyright
-    Holder. 
+    Holder.
   - "Copyright Holder" is whoever is named in the copyright or copyrights for
-    the package. 
+    the package.
   - "You" is you, if you're thinking about copying or distributing this Package.
   - "Reasonable copying fee" is whatever you can justify on the basis of media
     cost, duplication charges, time of people involved, and so on. (You will
     not be required to justify it to the Copyright Holder, but only to the
-    computing community at large as a market that must bear the fee.) 
+    computing community at large as a market that must bear the fee.)
   - "Freely Available" means that no fee is charged for the item itself, though
     there may be fees involved in handling the item. It also means that
     recipients of the item may redistribute it under the same conditions they
-    received it. 
+    received it.
 
 1. You may make and give away verbatim copies of the source form of the
 Standard Version of this Package without restriction, provided that you
@@ -373,7 +373,7 @@ products derived from this software without specific prior written permission.
 
 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
 WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
 The End
 
diff --git a/MANIFEST b/MANIFEST
index 3cf9f3c..06c5251 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.005.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.030.
 Build.PL
 Changes
 INSTALL
@@ -9,9 +9,9 @@ META.yml
 README
 dist.ini
 lib/Dist/Zilla/Plugin/ModuleBuildTiny.pm
+t/00-compile.t
 t/basic.t
 t/perl-prereq.t
 t/sharedir.t
 t/static_install.t
-xt/author/00-compile.t
 xt/author/pod-syntax.t
diff --git a/META.json b/META.json
index bd5ec4c..71c44c6 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
       "Leon Timmermans <fawaka@gmail.com>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Dist::Zilla version 6.005, CPAN::Meta::Converter version 2.150005",
+   "generated_by" : "Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010",
    "license" : [
       "perl_5"
    ],
@@ -17,18 +17,13 @@
       "configure" : {
          "requires" : {
             "Module::Build::Tiny" : "0.034",
-            "perl" : "5.004"
+            "perl" : "v5.4.5"
          }
       },
       "develop" : {
          "requires" : {
-            "File::Spec" : "0",
-            "IO::Handle" : "0",
-            "IPC::Open3" : "0",
             "Test::More" : "0",
             "Test::Pod" : "1.41",
-            "blib" : "1.01",
-            "perl" : "5.006",
             "strict" : "0",
             "warnings" : "0"
          }
@@ -47,6 +42,7 @@
             "Module::Metadata" : "0",
             "Moose" : "0",
             "Moose::Util::TypeConstraints" : "0",
+            "MooseX::Types::Moose" : "0",
             "MooseX::Types::Perl" : "0",
             "perl" : "5.006"
          }
@@ -54,6 +50,9 @@
       "test" : {
          "requires" : {
             "CPAN::Meta" : "0",
+            "File::Spec" : "0",
+            "IO::Handle" : "0",
+            "IPC::Open3" : "0",
             "Path::Tiny" : "0",
             "Test::DZil" : "0",
             "Test::Deep" : "0",
@@ -68,14 +67,13 @@
    "provides" : {
       "Dist::Zilla::Plugin::ModuleBuildTiny" : {
          "file" : "lib/Dist/Zilla/Plugin/ModuleBuildTiny.pm",
-         "version" : "0.015"
+         "version" : "0.016"
       }
    },
    "release_status" : "stable",
    "resources" : {
       "bugtracker" : {
-         "mailto" : "bug-dist-zilla-plugin-modulebuildtiny at rt.cpan.org",
-         "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-ModuleBuildTiny"
+         "web" : "https://github.com/Leont/dist-zilla-plugin-modulebuildtiny/issues"
       },
       "repository" : {
          "type" : "git",
@@ -83,10 +81,10 @@
          "web" : "https://github.com/Leont/dist-zilla-plugin-modulebuildtiny"
       }
    },
-   "version" : "0.015",
-   "x_contributors" : [
-      "Karen Etheridge <ether@cpan.org>"
-   ],
+   "version" : "0.016",
+   "x_generated_by_perl" : "v5.36.1",
+   "x_serialization_backend" : "Cpanel::JSON::XS version 4.36",
+   "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later",
    "x_static_install" : 1
 }
 
diff --git a/META.yml b/META.yml
index c2c5ada..f5e14be 100644
--- a/META.yml
+++ b/META.yml
@@ -4,6 +4,9 @@ author:
   - 'Leon Timmermans <fawaka@gmail.com>'
 build_requires:
   CPAN::Meta: '0'
+  File::Spec: '0'
+  IO::Handle: '0'
+  IPC::Open3: '0'
   Path::Tiny: '0'
   Test::DZil: '0'
   Test::Deep: '0'
@@ -14,9 +17,9 @@ build_requires:
   warnings: '0'
 configure_requires:
   Module::Build::Tiny: '0.034'
-  perl: '5.004'
+  perl: v5.4.5
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 6.005, CPAN::Meta::Converter version 2.150005'
+generated_by: 'Dist::Zilla version 6.030, CPAN::Meta::Converter version 2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -25,7 +28,7 @@ name: Dist-Zilla-Plugin-ModuleBuildTiny
 provides:
   Dist::Zilla::Plugin::ModuleBuildTiny:
     file: lib/Dist/Zilla/Plugin/ModuleBuildTiny.pm
-    version: '0.015'
+    version: '0.016'
 requires:
   Dist::Zilla: '4.300039'
   Dist::Zilla::File::InMemory: '0'
@@ -39,12 +42,14 @@ requires:
   Module::Metadata: '0'
   Moose: '0'
   Moose::Util::TypeConstraints: '0'
+  MooseX::Types::Moose: '0'
   MooseX::Types::Perl: '0'
   perl: '5.006'
 resources:
-  bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Dist-Zilla-Plugin-ModuleBuildTiny
+  bugtracker: https://github.com/Leont/dist-zilla-plugin-modulebuildtiny/issues
   repository: git://github.com/Leont/dist-zilla-plugin-modulebuildtiny.git
-version: '0.015'
-x_contributors:
-  - 'Karen Etheridge <ether@cpan.org>'
+version: '0.016'
+x_generated_by_perl: v5.36.1
+x_serialization_backend: 'YAML::Tiny version 1.74'
+x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later'
 x_static_install: 1
diff --git a/README b/README
index a994ad4..4804e39 100644
--- a/README
+++ b/README
@@ -1,7 +1,5 @@
-
-
 This archive contains the distribution Dist-Zilla-Plugin-ModuleBuildTiny,
-version 0.015:
+version 0.016:
 
   Build a Build.PL that uses Module::Build::Tiny
 
@@ -11,5 +9,4 @@ This is free software; you can redistribute it and/or modify it under
 the same terms as the Perl 5 programming language system itself.
 
 
-This README file was generated by Dist::Zilla::Plugin::Readme v6.005.
-
+This README file was generated by Dist::Zilla::Plugin::Readme v6.030.
diff --git a/debian/changelog b/debian/changelog
index 22a2d72..732c35c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libdist-zilla-plugin-modulebuildtiny-perl (0.016-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Wed, 03 May 2023 12:59:59 -0000
+
 libdist-zilla-plugin-modulebuildtiny-perl (0.015-2) unstable; urgency=medium
 
   [ Damyan Ivanov ]
diff --git a/dist.ini b/dist.ini
index fab3ffe..8022e13 100644
--- a/dist.ini
+++ b/dist.ini
@@ -6,9 +6,45 @@ copyright_year   = 2011
 
 ;Building
 [Bootstrap::lib]
-[@LEONT]
-install_tool = mbt
--remove = PodCoverageTests
-ModuleBuildTiny.static = auto
+
+[Git::GatherDir]
+[PruneCruft]
+[MetaYAML]
+[License]
+[Manifest]
+[Readme]
+
+[AutoPrereqs]
+[MetaJSON]
+[GitHub::Meta]
+[Git::NextVersion]
+[MetaProvides::Package]
+
+[ModuleBuildTiny]
+static = auto
+
+[Test::Compile]
+[PodSyntaxTests]
+; [PodCoverageTests]
+
+[InstallGuide]
+[PodWeaver]
+[PkgVersion]
+[NextRelease]
+
+[CheckChangesHasContent]
+[Git::Check]
+[RunExtraTests]
+[TestRelease]
+[ConfirmRelease]
+
+[MinimumPerl]
+
+[UploadToCPAN]
+
+[Git::Commit]
+[Git::Tag]
+[Git::Push]
+
 [Prereqs]
 Module::Build::Tiny = 0.039
diff --git a/lib/Dist/Zilla/Plugin/ModuleBuildTiny.pm b/lib/Dist/Zilla/Plugin/ModuleBuildTiny.pm
index b2a0bde..c5ed1f0 100644
--- a/lib/Dist/Zilla/Plugin/ModuleBuildTiny.pm
+++ b/lib/Dist/Zilla/Plugin/ModuleBuildTiny.pm
@@ -1,5 +1,5 @@
 package Dist::Zilla::Plugin::ModuleBuildTiny;
-$Dist::Zilla::Plugin::ModuleBuildTiny::VERSION = '0.015';
+$Dist::Zilla::Plugin::ModuleBuildTiny::VERSION = '0.016';
 use Moose;
 with qw/
 	Dist::Zilla::Role::BuildPL
@@ -13,8 +13,34 @@ use Dist::Zilla 4.300039;
 use Module::Metadata;
 use Moose::Util::TypeConstraints 'enum';
 use MooseX::Types::Perl qw/StrictVersionStr/;
+use MooseX::Types::Moose qw(Str ArrayRef HashRef);
 use List::Util 1.33 qw/first any/;
 
+sub mvp_multivalue_args { qw(header_strs footer_strs) }
+
+sub mvp_aliases {
+    +{
+        header => 'header_strs',
+        footer => 'footer_strs',
+    }
+}
+
+around BUILDARGS => sub {
+    my $orig = shift;
+    my $class = shift;
+
+    my $args = $class->$orig(@_);
+
+    my $delimiter = delete $args->{delimiter};
+    if (defined $delimiter and length($delimiter)) {
+        foreach my $arg (grep exists $args->{$_}, qw(header_strs footer_strs)) {
+            s/^\Q$delimiter\E// foreach @{$args->{$arg}};
+        }
+    }
+
+    return $args;
+};
+
 has version_method => (
 	is      => 'ro',
 	isa     => enum(['installed', 'conservative']),
@@ -56,6 +82,9 @@ has version => (
 		if ($self->version_method eq 'installed') {
 			return Module::Metadata->new_from_module('Module::Build::Tiny')->version->stringify;
 		}
+		elsif (-e 'include/' or any { $_->name =~ /^src\/.*\.c$/} @{ $self->zilla->files }) {
+			return '0.044';
+		}
 		elsif ($self->has_pl) {
 			return '0.039';
 		}
@@ -78,14 +107,86 @@ has minimum_perl => (
 	},
 );
 
+has header_strs => (
+	is => 'ro', isa => ArrayRef[Str],
+	traits => ['Array'],
+	lazy => 1,
+	default => sub { [] },
+	documentation => "Additional code lines to include at the beginning of Makefile.PL",
+);
+
+has header_file => (
+	is => 'ro', isa => Str,
+	documentation => 'Additional header content to include from a file',
+);
+
+has header => (
+	is            => 'ro',
+	isa           => Str,
+	lazy          => 1,
+	builder       => '_build_header',
+	documentation => "A string included at the beginning of Makefile.PL",
+);
+
+sub _build_header {
+	my $self = shift;
+	join "\n",
+		@{$self->header_strs},
+		( $self->header_file
+			? do {
+				my $abs_file = path($self->zilla->root, $self->header_file);
+				$self->log_fatal([ 'header_file %s does not exist!', $self->header_file ])
+					if not $abs_file->exists;
+				$abs_file->slurp_utf8
+			}
+			: () );
+}
+
+has footer_strs => (
+	is => 'ro', isa => ArrayRef[Str],
+	traits => ['Array'],
+	lazy => 1,
+	default => sub { [] },
+	documentation => "Additional code lines to include at the end of Makefile.PL",
+);
+
+has footer_file => (
+	is => 'ro', isa => Str,
+	documentation => 'Additional footer content to include from a file',
+);
+
+has footer => (
+	is			=> 'ro',
+	isa		   => Str,
+	lazy		  => 1,
+	builder	   => '_build_footer',
+	documentation => "A string included at the end of Makefile.PL",
+);
+
+sub _build_footer {
+	my $self = shift;
+	join "\n",
+		@{$self->footer_strs},
+		( $self->footer_file
+			? do {
+				my $abs_file = path($self->zilla->root, $self->footer_file);
+				$self->log_fatal([ 'footer_file %s does not exist!', $self->footer_file ])
+					if not $abs_file->exists;
+				$abs_file->slurp_utf8
+			}
+			: () );
+}
+
+
 my $template = <<'BUILD_PL';
 # This Build.PL for {{ $dist_name }} was generated by {{ $plugin_title }}.
 use strict;
 use warnings;
-
+{{ $header }}
 use {{ $minimum_perl }};
 use Module::Build::Tiny{{ $version ne 0 && " $version" }};
 Build_PL();
+{{ $footer }}
 BUILD_PL
 
 sub register_prereqs {
@@ -149,6 +250,8 @@ sub setup_installer {
 			minimum_perl => $self->minimum_perl,
 			dist_name    => $self->zilla->name,
 			plugin_title => ref($self) . ' ' . ($self->VERSION || '<self>'),
+			header       => $self->header,
+			footer       => $self->footer,
 		});
 
 	$self->log_debug([ 'updating contents of Build.PL in memory' ]);
@@ -179,7 +282,7 @@ Dist::Zilla::Plugin::ModuleBuildTiny - Build a Build.PL that uses Module::Build:
 
 =head1 VERSION
 
-version 0.015
+version 0.016
 
 =head1 DESCRIPTION
 
@@ -241,6 +344,23 @@ checked.
 
 =back
 
+=head2 header
+
+A line of code which is included near the top of F<Build.PL>.  Can be used more than once.
+
+=head2 footer
+
+A line of code which is included at the bottom of F<Build.PL>.  Can be used more than once.
+
+=head2 delimiter
+
+A string, usually a single character, which is stripped from the beginning of
+all C<header>, and C<footer> lines. This is because the
+INI file format strips all leading whitespace from option values, so including
+this character at the front allows you to use leading whitespace in an option
+string.  This is helpful for the formatting of F<Build.PL>s, but a nice thing
+to have when inserting any block of code.
+
 =head1 AUTHOR
 
 Leon Timmermans <fawaka@gmail.com>
diff --git a/xt/author/00-compile.t b/t/00-compile.t
similarity index 62%
rename from xt/author/00-compile.t
rename to t/00-compile.t
index a439984..73d440d 100644
--- a/xt/author/00-compile.t
+++ b/t/00-compile.t
@@ -2,11 +2,11 @@ use 5.006;
 use strict;
 use warnings;
 
-# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.054
+# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058
 
 use Test::More;
 
-plan tests => 2;
+plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
 
 my @module_files = (
     'Dist/Zilla/Plugin/ModuleBuildTiny.pm'
@@ -16,7 +16,9 @@ my @module_files = (
 
 # no fake home requested
 
-my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
+my @switches = (
+    -d 'blib' ? '-Mblib' : '-Ilib',
+);
 
 use File::Spec;
 use IPC::Open3;
@@ -30,14 +32,18 @@ for my $lib (@module_files)
     # see L<perlfaq8/How can I capture STDERR from an external command?>
     my $stderr = IO::Handle->new;
 
-    my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
+    diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
+            $^X, @switches, '-e', "require q[$lib]"))
+        if $ENV{PERL_COMPILE_TEST_DEBUG};
+
+    my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
     binmode $stderr, ':crlf' if $^O eq 'MSWin32';
     my @_warnings = <$stderr>;
     waitpid($pid, 0);
     is($?, 0, "$lib loaded ok");
 
     shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/
-        and not eval { require blib; blib->VERSION('1.01') };
+        and not eval { +require blib; blib->VERSION('1.01') };
 
     if (@_warnings)
     {
@@ -49,6 +55,6 @@ for my $lib (@module_files)
 
 
 is(scalar(@warnings), 0, 'no warnings found')
-    or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) );
+    or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING};
 
 
diff --git a/t/basic.t b/t/basic.t
index ce4d0b9..6bf112d 100644
--- a/t/basic.t
+++ b/t/basic.t
@@ -33,6 +33,7 @@ use warnings;
 use $];
 use Module::Build::Tiny 0.034;
 Build_PL();
+
 END
 
 my $base = path($tzil->built_in);
diff --git a/t/perl-prereq.t b/t/perl-prereq.t
index 0e52057..82f6f6b 100644
--- a/t/perl-prereq.t
+++ b/t/perl-prereq.t
@@ -31,6 +31,7 @@ use warnings;
 use 5.010;
 use Module::Build::Tiny 0.034;
 Build_PL();
+
 END
 
 is(path($tzil->built_in)->child('Build.PL')->slurp, $expected, 'Build.PL declares the correct minimum perl version');

Debdiff

File lists identical (after any substitutions)

No differences were encountered in the control files

More details

Full run details