From: Graham Knop Date: Fri, 30 Mar 2018 10:16:34 +0000 (+0200) Subject: generate README at dist built time rather than configure time X-Git-Tag: v0.10014~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e0a942a728754d0ac3b3696bd72fe82cc888ceae;p=p5sagit%2FClass-Accessor-Grouped.git generate README at dist built time rather than configure time --- diff --git a/Makefile.PL b/Makefile.PL index 58067c1..2e40d73 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -85,8 +85,19 @@ my %MM_ARGS = ( (-e 'META.yml' ? () : test => { TESTS => 't/*.t xt/*.t xt/*/*.t' } ), ); -if (!-e 'META.yml') { - system('pod2text lib/Class/Accessor/Grouped.pm > README'); +{ + package MY; + sub distdir { + my ($self, @arg) = @_; + my $frag = $self->SUPER::distdir(@arg); + $frag =~ s/^(distdir\s*:.*)/$1 create_readme/m; + $frag .= <<'END_MAKE'; +create_readme: create_distdir + pod2text lib/Class/Accessor/Grouped.pm > $(DISTVNAME)/README + cd $(DISTVNAME) && $(PERLRUN) "-MExtUtils::Manifest=maniadd" -e "maniadd({ README => 'Generated README' })" +END_MAKE + $frag; + } } use Text::ParseWords;