Fixed pod and added Catalyst::Utils::appprefix
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Build.pm
index c314ad8..47be034 100644 (file)
@@ -6,11 +6,12 @@ use base 'Module::Build';
 use Path::Class;
 use File::Find 'find';
 
+our @ignore =
+  qw/Build Build.PL Changes MANIFEST META.yml Makefile.PL Makefile README
+  _build blib lib script t/;
+
 our $FAKE;
-our $ignore = '^('
-  . join( '|',
-    qw/Build Build.PL Changes Makefile.PL README _build blib lib script t/ )
-  . ')$';
+our $ignore = '^(' . join( '|', @ignore ) . ')$';
 
 =head1 NAME
 
@@ -26,6 +27,8 @@ L<Module::Build> extension for Catalyst.
 
 =head1 METHODS
 
+=over 4
+
 =item ACTION_install
 
 =cut
@@ -52,18 +55,16 @@ sub ACTION_fakeinstall {
 =cut
 
 sub ACTION_install_extras {
-    my $self   = shift;
-    my $prefix = $self->{properties}{destdir} || '';
-    my $path   = dir(
-        $prefix,
-        $self->{config}{installsitelib},
-        split( '::', $self->{properties}{module_name} )
-    );
-    my @files = $self->_find_extras;
+    my $self    = shift;
+    my $prefix  = $self->{properties}{destdir} || undef;
+    my $sitelib = $self->install_destination('lib');
+    my @path    = defined $prefix ? ( $prefix, $sitelib ) : ($sitelib);
+    my $path    = dir( @path, split( '::', $self->{properties}{module_name} ) );
+    my @files   = $self->_find_extras;
     print "Installing extras to $path\n";
     for (@files) {
         $FAKE
-          ? print "$_ -> $path/$_ (FAKE)\n"
+          ? print "$_ -> $path (FAKE)\n"
           : $self->copy_if_modified( $_, $path );
     }
 }
@@ -96,8 +97,8 @@ Sebastian Riedel, C<sri@oook.de>
 
 =head1 LICENSE
 
-This library is free software . You can redistribute it and/or modify it under
-the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify it under
+the same terms as Perl itself.
 
 =cut