From 759435399ec772d303582c4040bba5adf3cfe66b Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 28 Feb 2014 23:28:40 +0200 Subject: [PATCH] Make mod_perl optional, silence smartmatch warnings --- Makefile.PL | 14 ++++++++++---- lib/Apache2/AuthzCaps.pm | 8 +++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index c3bab38..d2cd36f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -7,10 +7,16 @@ WriteMakefile( AUTHOR => 'Marius Gavrilescu ', MIN_PERL_VERSION => '5.14.0', LICENSE => 'perl', + SIGN => 1, PREREQ_PM => { - Apache2::Access => 0, - Apache2::Const => 0, - Apache2::RequestRec => 0, - YAML::Any => 0, + qw/YAML::Any 0/, }, + META_MERGE => { + dynamic_config => 0, + recommends => { + qw/Apache2::Access 0 + Apache2::Const 0 + Apache2::RequestRec 0/, + } + } ); diff --git a/lib/Apache2/AuthzCaps.pm b/lib/Apache2/AuthzCaps.pm index ac16d17..b0ccffc 100644 --- a/lib/Apache2/AuthzCaps.pm +++ b/lib/Apache2/AuthzCaps.pm @@ -3,10 +3,12 @@ package Apache2::AuthzCaps 0.001; use 5.014000; use strict; use warnings; +use subs qw/OK DECLINED/; +no if $] >= 5.017011, warnings => 'experimental::smartmatch'; -use Apache2::Access; -use Apache2::Const qw/OK DECLINED/; -use Apache2::RequestRec; +use if $ENV{MOD_PERL}, 'Apache2::Access'; +use if $ENV{MOD_PERL}, 'Apache2::Const' => qw/OK DECLINED/; +use if $ENV{MOD_PERL}, 'Apache2::RequestRec'; use YAML::Any qw/LoadFile DumpFile/; use parent qw/Exporter/; -- 2.39.2