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 v5.042.
use strict;
use warnings;

use 5.010001;

use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
  "ABSTRACT" => "Utilities for serialization tasks",
  "AUTHOR" => "perlancar <perlancar\@cpan.org>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0,
    "Perl::osnames" => "0.09"
  },
  "DISTNAME" => "App-SerializeUtils",
  "EXE_FILES" => [
    "bin/check-json",
    "bin/check-phpser",
    "bin/check-yaml",
    "bin/dd2ddc",
    "bin/dd2json",
    "bin/dd2phpser",
    "bin/dd2sereal",
    "bin/dd2storable",
    "bin/dd2yaml",
    "bin/json2dd",
    "bin/json2ddc",
    "bin/json2phpser",
    "bin/json2sereal",
    "bin/json2storable",
    "bin/json2yaml",
    "bin/phpser2dd",
    "bin/phpser2ddc",
    "bin/phpser2json",
    "bin/phpser2sereal",
    "bin/phpser2storable",
    "bin/phpser2yaml",
    "bin/pp-json",
    "bin/sereal2dd",
    "bin/sereal2ddc",
    "bin/sereal2json",
    "bin/sereal2phpser",
    "bin/sereal2storable",
    "bin/sereal2yaml",
    "bin/serializeutils-convert",
    "bin/storable2dd",
    "bin/storable2ddc",
    "bin/storable2json",
    "bin/storable2phpser",
    "bin/storable2sereal",
    "bin/storable2yaml",
    "bin/yaml2dd",
    "bin/yaml2ddc",
    "bin/yaml2json",
    "bin/yaml2phpser",
    "bin/yaml2sereal",
    "bin/yaml2storabls"
  ],
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.010001",
  "NAME" => "App::SerializeUtils",
  "PREREQ_PM" => {
    "Data::Dump" => 0,
    "Data::Dump::Color" => 0,
    "JSON" => 0,
    "JSON::PP" => 0,
    "JSON::XS" => 0,
    "PHP::Serialization" => 0,
    "Sereal::Decoder" => 0,
    "Sereal::Encoder" => 0,
    "YAML::Syck" => 0,
    "YAML::XS" => 0
  },
  "TEST_REQUIRES" => {
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,
    "Test::More" => 0
  },
  "VERSION" => "0.09",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Data::Dump" => 0,
  "Data::Dump::Color" => 0,
  "File::Spec" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "JSON" => 0,
  "JSON::PP" => 0,
  "JSON::XS" => 0,
  "PHP::Serialization" => 0,
  "Sereal::Decoder" => 0,
  "Sereal::Encoder" => 0,
  "Test::More" => 0,
  "YAML::Syck" => 0,
  "YAML::XS" => 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);

# modify generated Makefile to generate shell completion scripts. this piece
# is generated by Dist::Zilla::Plugin::GenShellCompletion version 0.09.
GEN_SHELL_COMPLETION:
{
    require Perl::osnames;
    last unless Perl::osnames::is_posix();

    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", @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;
}