From: Marius Gavrilescu Date: Fri, 28 Feb 2014 21:28:40 +0000 (+0200) Subject: Make mod_perl optional, silence smartmatch warnings X-Git-Tag: 0.001001~1 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=759435399ec772d303582c4040bba5adf3cfe66b;p=apache2-authzcaps.git Make mod_perl optional, silence smartmatch warnings --- 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/;