aboutsummaryrefslogtreecommitdiff
path: root/Makefile.PL
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2018-04-17 07:38:14 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2018-04-17 07:38:14 +0200
commit18b7e9a0e70e4fb03c5c1019a6f60fd39260dc58 (patch)
treece8dc1d82e89f6bf91ab305d20f03386cdb162f9 /Makefile.PL
parent503aed733443178c8c5113da85b34d8a2b44eb95 (diff)
downloadacmeman-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.
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL58
1 files changed, 34 insertions, 24 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,27 +33,29 @@ use ExtUtils::AutoInstall (
'Data::Dumper' => 0,
'Net::DNS' => 1.06,
'Sys::Hostname' => 1.16
- }
+ },
+
+ MIN_PERL_VERSION => 5.006,
+ META_MERGE => {
+ 'meta-spec' => { version => 2 },
+ resources => {
+ repository => {
+ type => 'git',
+ url => 'git://git.gnu.org.ua/gsc/acmeman.git',
+ web => 'http://git.gnu.org.ua/cgit/gsc/acmeman.git/',
+ },
+ },
+ provides => Module::Metadata->provides(version => '1.4',
+ dir => 'lib')
+ }
);
-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 },
- resources => {
- repository => {
- type => 'git',
- url => 'git://git.gnu.org.ua/gsc/acmeman.git',
- web => 'http://git.gnu.org.ua/cgit/gsc/acmeman.git/',
- },
- },
- 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);

Return to:

Send suggestions and report system problems to the System administrator.