diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-04-17 07:38:14 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-04-17 07:38:14 +0200 |
commit | 18b7e9a0e70e4fb03c5c1019a6f60fd39260dc58 (patch) | |
tree | ce8dc1d82e89f6bf91ab305d20f03386cdb162f9 | |
parent | 503aed733443178c8c5113da85b34d8a2b44eb95 (diff) | |
download | acmeman-18b7e9a0e70e4fb03c5c1019a6f60fd39260dc58.tar.gz acmeman-18b7e9a0e70e4fb03c5c1019a6f60fd39260dc58.tar.bz2 |
Provide an option to skip autoinstall on compile time
Running
perl Makefile.PL --no-autoinstall
skips the use of ExtUtils::Autoinstall. This is useful when building
the package for various distributions.
* Makefile.PL: Use plain MakeMaker if given the --no-autoinstall option
* acmeman: Change NAME section.
-rw-r--r-- | Makefile.PL | 32 | ||||
-rwxr-xr-x | acmeman | 2 |
2 files changed, 22 insertions, 12 deletions
diff --git a/Makefile.PL b/Makefile.PL index d1f6d77..b46bd45 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,9 +2,17 @@ use strict; use lib 'inc'; use Module::Metadata; +use Getopt::Long qw(:config gnu_getopt no_ignore_case); +use ExtUtils::MakeMaker; -use ExtUtils::AutoInstall ( - -core => { +my %makefile_args = ( + NAME => 'App::Acmeman', + ABSTRACT_FROM => 'acmeman', + VERSION_FROM => 'acmeman', + AUTHOR => 'Sergey Poznyakoff <gray@gnu.org>', + LICENSE => 'gpl_3', + EXE_FILES => [ 'acmeman' ], + PREREQ_PM => { 'Getopt::Long' => 2.34, 'File::Path' => 2.08, 'File::Basename' => 2.84, @@ -25,15 +33,8 @@ use ExtUtils::AutoInstall ( 'Data::Dumper' => 0, 'Net::DNS' => 1.06, 'Sys::Hostname' => 1.16 - } -); + }, -WriteMakefile(NAME => 'App::Acmeman', - ABSTRACT_FROM => 'acmeman', - VERSION_FROM => 'acmeman', - AUTHOR => 'Sergey Poznyakoff <gray@gnu.org>', - LICENSE => 'gpl_3', - EXE_FILES => [ 'acmeman' ], MIN_PERL_VERSION => 5.006, META_MERGE => { 'meta-spec' => { version => 2 }, @@ -47,5 +48,14 @@ WriteMakefile(NAME => 'App::Acmeman', provides => Module::Metadata->provides(version => '1.4', dir => 'lib') } - ); + +my $no_autoinstall; +GetOptions('no-autoinstall|N' => \$no_autoinstall) or exit(1); +unless ($no_autoinstall) { + require ExtUtils::AutoInstall; + ExtUtils::AutoInstall->import(-core => $makefile_args{PREREQ_PM}); + delete $makefile_args{PREREQ_PM}; +} + +WriteMakefile(%makefile_args); @@ -41,7 +41,7 @@ our $VERSION = '1.05'; =head1 NAME -acmeman - manages ACME certificates +App::Acmeman - manages ACME certificates =head1 SYNOPSIS |