use 5.010; use strict; use warnings; use ExtUtils::MakeMaker; ################################ # BEGIN CUSTOMIZATION ################################ # used to be passed to WriteMakefile my %meta_merge_args; if (!-e 'META.yml') { my $ask_for_git = prompt ("*** CUSTOM *** (only relevant for author) Do you want to specify a git repository (y or N)?:"); if ( $ask_for_git =~ /^y/i ){ my $git_repo = prompt ("*** CUSTOM *** Full URL of the git repository:"); die "Empty git repository! Answer n to the previous question if you dont want to specify a git repository!" unless length $git_repo; $git_repo =~ s/\/$//; my $git_file = prompt ("*** CUSTOM *** Full URL of git repository file:", $git_repo.'.git'); my $git_issues = $git_repo.( $git_repo =~ /gitlab.com/ ? '/-' : '').'/issues'; $git_issues = prompt ("*** CUSTOM *** Full URL for git issues:", $git_issues); my $home_page = prompt ("*** CUSTOM *** Full URL of an eventual homepage?:", $git_repo); # fill in the %meta_merge_args in the main package $meta_merge_args{ META_MERGE } = { 'meta-spec' => { version => 2 }, 'resources' => { 'repository' => { 'type' => 'git', 'url' => $git_file, 'web' => $git_repo, }, 'bugtracker' => { 'web' => $git_issues, }, 'homepage' => $home_page, } }; } } # override MY::distdir # see https://perldoc.perl.org/ExtUtils::MakeMaker#Overriding-MakeMaker-Methods package MY; # so that "SUPER" works right sub distdir { # SAVE WHAT RECEIVED BY THE ORIGINAL distdir my $inherited = $_[0]->SUPER::distdir(@_); #print "DEBUG -->$inherited<--\n"; # uncomment to see what is passed # CALL THE DEFAULT distdir $_[0]->SUPER::distdir(@_); # README: update the README using the POD from main module my $make_readme =<<'MAKE_README'; $(TOUCH) README $(NOECHO) $(ECHO) > README $(NOECHO) $(ECHO) *** CUSTOM *** Generating README from POD of $(VERSION_FROM) $(PERLRUN) -MPod::Text \ -e "Pod::Text->new (sentence => 1, width => 78)->parse_from_file( qq( $(VERSION_FROM) ) ) or die $$!;" >> README $(NOECHO) $(ECHO) *** autogenerated by a lazy Makefile.PL *** >> README $(NOECHO) $(ECHO) *** CUSTOM *** Regenerating MANIFEST $(PERLRUN) -M"5;push @ARGV,'MANIFEST'" -nle "print unless /^README$$/" >> MANIFEST.new $(NOECHO) $(ECHO) *** CUSTOM *** Updating MANIFEST with README entry $(NOECHO) $(ECHO) README >> MANIFEST.new $(MV) MANIFEST.new MANIFEST $(CP) MANIFEST $(DISTVNAME)/MANIFEST $(CP) README $(DISTVNAME)/README MAKE_README # make NEEDS tabs: ensure they are there $make_readme =~ s/^\s+/\t/gm; return join '', $inherited, $make_readme; } # back to main package package main; WriteMakefile( %meta_merge_args, ################################################## # END CUSTOMIZATION ################################################## # DEFAULT content made by module-starter NAME => 'Games::Dice::Roller', AUTHOR => q{LorenzoTa }, VERSION_FROM => 'lib/Games/Dice/Roller.pm', ABSTRACT_FROM => 'lib/Games/Dice/Roller.pm', LICENSE => 'artistic_2', PL_FILES => {}, MIN_PERL_VERSION => '5.010', CONFIGURE_REQUIRES => { 'ExtUtils::MakeMaker' => '0', }, BUILD_REQUIRES => { 'Test::More' => '0', 'Test::Exception' => '0', }, PREREQ_PM => { Carp => 0, }, );