freebsd-ports/www/p5-Gantry/files/patch-Build.PL
2007-05-30 01:48:55 +00:00

130 lines
3.6 KiB
Perl

--- Build.PL.orig Tue May 1 05:49:23 2007
+++ Build.PL Wed May 2 09:23:17 2007
@@ -36,10 +36,10 @@
web_files => \@web_dirs,
build_web_directory => 'root',
install_web_directories => {
- 'default' => '/home/httpd/html/gantry',
- 'prod' => '/home/httpd/html/gantry',
- 'dev' => '/home/httpd/html/gantry',
- 'tim' => '/home/tkeefer/httpd/html/gantry'
+ 'default' => '/usr/local/www/data/gantry',
+ 'prod' => '/usr/local/www/data/gantry',
+ 'dev' => '/usr/local/www/data/gantry',
+ 'tim' => '/usr/local/www/data/gantry'
},
create_makefile_pl => 'passthrough',
license => 'perl',
@@ -105,7 +105,7 @@
if ( not -d $template_path ) {
my $make_path = $build->y_n(
"$template_path does not exist, should I make it?",
- 'y'
+ 'n'
);
if ( $make_path ) {
@@ -139,103 +139,6 @@
}
- sub ACTION_install {
- my $self = shift;
-
- my $p = $self->{properties};
-
- my $initf = "$p->{install_sets}{site}{lib}/$p->{dist_name}/Init.pm";
-
- $self->SUPER::ACTION_install();
-
- my $tmpl_dir = $self->notes( 'install_web_directory' );
-
- if( $tmpl_dir && $tmpl_dir ne '__skip__' ) {
-
- # write Init.pm file with install options
-
- my $init_pkg = << "EO_INIT";
-package Gantry::Init;
-use strict;
-
-sub base_root {
- return "$tmpl_dir";
-}
-1;
-
-=head1 NAME
-
-Gantry::Init - stores things the user provided to Build.PL during install
-
-=head1 SYNOPSIS
-
- use Gantry::Init;
- my \$base_root = Gantry::Init->base_root();
-
-=head1 Methods
-
-=head2 base_root
-
-Returns the local system path to Gantry's default templates. This usually
-becomes the last item in the Template Toolkit template path.
-
-=head1 AUTHOR
-
-Auto-generated by Build.PL
-
-=cut
-
-EO_INIT
-
- for my $dst ("blib/lib/Gantry/Init.pm", $initf) {
- my $orig_mode = (stat $dst)[2];
- my $rw_mode = 0666;
- chmod $rw_mode, $dst or die "Can't chmod $rw_mode $dst: $!";
- open( INIT_FILE, "> $dst" ) or die "$!";
- print INIT_FILE $init_pkg;
- close INIT_FILE;
-
- # restore the perms
- chmod $orig_mode, $dst or die "Can't chmod $orig_mode $dst: $!";
- }
-
- eval {
- # this should have been done during perl Build.PL
- if ( not -d $tmpl_dir ) {
- File::Path::mkpath( $tmpl_dir );
- }
- };
- if ( $@ ) {
- print "Error: unable to create directory $tmpl_dir\n";
- $@ =~ s/ at .+?$//;
- die( "$@\n" );
- }
-
- my $blib_tmpl_dir = File::Spec->catdir(
- $self->blib, 'web', $p->{build_web_directory}
- );
-
- eval {
- require File::Copy::Recursive;
- import File::Copy::Recursive 'dircopy';
-
- $num = dircopy($blib_tmpl_dir, $tmpl_dir) || 0;
- };
- if ( $@ ) {
- print "\nError coping templates:\n";
- print $@ . "\n";
- }
- else {
- print "\n$num Gantry templates copied to $tmpl_dir\n";
- }
- }
- else {
- print "SKIPPING WEB CONTENT INSTALL\n";
- }
-
- print "\n";
-
- } # end ACTION_install
sub process_web_files {
my $self = shift;