From: Matt S Trout Date: Tue, 6 Jul 2010 01:27:55 +0000 (+0100) Subject: Makefile.PL and Author.PL X-Git-Tag: release_1.0.0~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FModule-Metadata.git;a=commitdiff_plain;h=a48911904f968b5f66cbcc1bfe3731939f95f338 Makefile.PL and Author.PL --- diff --git a/Author.PL b/Author.PL new file mode 100644 index 0000000..f13e291 --- /dev/null +++ b/Author.PL @@ -0,0 +1,51 @@ +use strict; +use warnings FATAL => 'all'; + +{ + package MY; + push @ExtUtils::MakeMaker::Overridable, 'find_tests'; + sub find_tests { + shift->SUPER::find_tests.' xt/*.t'; + } +} + +{ + no warnings 'redefine'; + sub WriteMakefile { + my %args = @_; + ExtUtils::MakeMaker::WriteMakefile( + %args, + AUTHOR => 'Ken Williams , Randy W. Sims ', + ABSTRACT_FROM => $args{VERSION_FROM}, + ); + } +} + +sub manifest_include { + use autodie; + my @files = @_; + my @parts; + while (my ($dir, $spec) = splice(@files, 0, 2)) { + my $re = ($dir ? $dir.'/' : ''). + ((ref($spec) eq 'Regexp') + ? $spec + : !ref($spec) + ? ".*\Q${spec}\E" + : die "spec must be string or regexp, was: ${spec} (${\ref $spec})"); + push @parts, $re; + } + my $final = '^(?!'.join('|', map "${_}\$", @parts).')'; + open my $skip, '>', 'MANIFEST.SKIP'; + print $skip "${final}\n"; + close $skip; +} + +manifest_include( + 'lib' => '.pm', + 't' => '.t', + 't/lib' => '.pm', + '' => '.PL', + '' => qr{Changes|MANIFEST|README|META\.yml} +); + +1; diff --git a/Makefile.PL b/Makefile.PL new file mode 100644 index 0000000..3f4bae3 --- /dev/null +++ b/Makefile.PL @@ -0,0 +1,10 @@ +use strict; +use warnings FATAL => 'all'; +use ExtUtils::MakeMaker; + +(do 'Author.PL' or die $@) unless -f 'META.yml'; + +WriteMakefile( + NAME => 'Module::Metadata', + VERSION_FROM => 'lib/Module/Metadata.pm' +);