The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.008.
use strict;
use warnings;

use 5.010001;

use ExtUtils::MakeMaker;

use File::ShareDir::Install;
$File::ShareDir::Install::INCLUDE_DOTFILES = 1;
$File::ShareDir::Install::INCLUDE_DOTDIRS = 1;
install_share dist => "share";


my %WriteMakefileArgs = (
  "ABSTRACT" => "Command-line utilities related to Perl modules",
  "AUTHOR" => "perlancar <perlancar\@cpan.org>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0,
    "File::ShareDir::Install" => "0.06"
  },
  "DISTNAME" => "App-PMUtils",
  "EXE_FILES" => [
    "bin/module-dir",
    "bin/pmbin",
    "bin/pmcat",
    "bin/pmchkver",
    "bin/pmcore",
    "bin/pmcost",
    "bin/pmdir",
    "bin/pmdoc",
    "bin/pmedit",
    "bin/pmhtml",
    "bin/pminfo",
    "bin/pmless",
    "bin/pmlines",
    "bin/pmlist",
    "bin/pmman",
    "bin/pmminversion",
    "bin/pmpath",
    "bin/pmstripper",
    "bin/pmuninst",
    "bin/pmversion",
    "bin/pmxs",
    "bin/podpath",
    "bin/pwd2mod",
    "bin/rel2mod"
  ],
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.010001",
  "NAME" => "App::PMUtils",
  "PREREQ_PM" => {
    "Browser::Open" => 0,
    "Complete::Module" => "0.09",
    "Config" => 0,
    "Cwd" => 0,
    "Data::Sah::Coerce::perl::str::str_normalize_perl_modname" => 0,
    "Data::Sah::Compiler::perl::TH::array" => 0,
    "Data::Sah::Compiler::perl::TH::bool" => 0,
    "Data::Sah::Compiler::perl::TH::str" => 0,
    "Dist::Util" => 0,
    "ExtUtils::MakeMaker" => 0,
    "File::ShareDir" => 0,
    "File::Spec" => 0,
    "File::Temp" => 0,
    "File::Util::Tempdir" => 0,
    "File::Which" => 0,
    "HTTP::Tiny" => 0,
    "IO::Prompt::I18N" => 0,
    "IPC::System::Options" => "0.27",
    "JSON::MaybeXS" => 0,
    "Log::Any::IfLOG" => "0.07",
    "Module::CoreList" => 0,
    "Module::CoreList::More" => 0,
    "Module::List" => 0,
    "Module::Load" => 0,
    "Module::Path::More" => "0.30",
    "Module::XSOrPP" => "0.08",
    "PERLANCAR::AppUtil::PerlStripper" => "0.03",
    "Perinci::CmdLine::Any" => "0.13",
    "Perinci::Sub::ArgEntity::perl_version" => 0,
    "Perinci::Sub::DepChecker" => 0,
    "Perl::MinimumVersion" => 0,
    "Perl::Stripper" => 0,
    "Sah::Schema::perl::modname" => 0,
    "SourceCode::LineCounter::Perl" => 0,
    "String::ShellQuote" => 0,
    "experimental" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,
    "Test::More" => 0
  },
  "VERSION" => "0.63",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Browser::Open" => 0,
  "Complete::Module" => "0.09",
  "Config" => 0,
  "Cwd" => 0,
  "Data::Sah::Coerce::perl::str::str_normalize_perl_modname" => 0,
  "Data::Sah::Compiler::perl::TH::array" => 0,
  "Data::Sah::Compiler::perl::TH::bool" => 0,
  "Data::Sah::Compiler::perl::TH::str" => 0,
  "Dist::Util" => 0,
  "ExtUtils::MakeMaker" => 0,
  "File::ShareDir" => 0,
  "File::Spec" => 0,
  "File::Temp" => 0,
  "File::Util::Tempdir" => 0,
  "File::Which" => 0,
  "HTTP::Tiny" => 0,
  "IO::Handle" => 0,
  "IO::Prompt::I18N" => 0,
  "IPC::Open3" => 0,
  "IPC::System::Options" => "0.27",
  "JSON::MaybeXS" => 0,
  "Log::Any::IfLOG" => "0.07",
  "Module::CoreList" => 0,
  "Module::CoreList::More" => 0,
  "Module::List" => 0,
  "Module::Load" => 0,
  "Module::Path::More" => "0.30",
  "Module::XSOrPP" => "0.08",
  "PERLANCAR::AppUtil::PerlStripper" => "0.03",
  "Perinci::CmdLine::Any" => "0.13",
  "Perinci::Sub::ArgEntity::perl_version" => 0,
  "Perinci::Sub::DepChecker" => 0,
  "Perl::MinimumVersion" => 0,
  "Perl::Stripper" => 0,
  "Sah::Schema::perl::modname" => 0,
  "SourceCode::LineCounter::Perl" => 0,
  "String::ShellQuote" => 0,
  "Test::More" => 0,
  "experimental" => 0,
  "strict" => 0,
  "warnings" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};
  $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}

delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };

WriteMakefile(%WriteMakefileArgs);

{
package
MY;
use File::ShareDir::Install qw(postamble);
}

# modify generated Makefile to generate shell completion scripts. this piece
# is generated by Dist::Zilla::Plugin::GenShellCompletion version 0.11.
GEN_SHELL_COMPLETION:
{
    last unless grep { $^O eq $_ } ("aix","beos","cygwin","darwin","dragonfly","freebsd","gnukfreebsd","haiku","hpux","interix","irix","linux","midnightbsd","minix","mirbsd","netbsd","openbsd","sco","solaris");

    print "Modifying Makefile to generate shell completion on install\n";
    open my($fh), "<", "Makefile" or die "Can't open generated Makefile: $!";
    my $content = do { local $/; ~~<$fh> };

    $content =~ s/^(install :: pure_install doc_install)/$1 comp_install/m
        or die "Can't find pattern in Makefile (1)";

    $content =~ s/^(uninstall :: .+)/$1 comp_uninstall/m
        or die "Can't find pattern in Makefile (2)";

    $content .= qq|\ncomp_install :\n\t| .
        q|$(PERLRUN) -E'if(eval { require App::shcompgen; 1 }) { system "shcompgen", "--verbose", "generate", "--replace", ($$App::shcompgen::VERSION >= 0.15 ? ("--remove"):()), @ARGV }' -- $(EXE_FILES)| .
        qq|\n\n|;

    $content .= qq|\ncomp_uninstall :\n\t| .
        q|$(PERLRUN) -E'if(eval { require App::shcompgen; 1 }) { system "shcompgen", "--verbose", "remove", @ARGV }' -- $(EXE_FILES)| .
        qq|\n\n|;

    open $fh, ">", "Makefile" or die "Can't write modified Makefile: $!";
    print $fh $content;
}