3 # This is the Shadowcat Catalyst installer. Its purpose is to make it easier
4 # and quicker to get started with Catalyst development. In order to use it,
5 # make sure you have perl 5.8.1+, a make and a compiler, (nmake and dev-c++
6 # are good on windows), a configured CPAN.pm and Module::Build installed. Then
7 # run this script by executing
9 # /path/to/perl cat-install
11 # and go for a tea break. If anything breaks, please send the full build log
12 # and the output of perl -V to <cat-install@shadowcatsystems.co.uk> and we'll
13 # see what we can do. This script is still BETA though, so don't be too
14 # surprised if something *does* break.
16 # See http://www.shadowcatsystems.co.uk/projects/catalyst/ for more information
17 # on the Catalyst project and Shadowcat's involvement with it.
21 # This software is Copyright (c) 2006 Shadowcat Systems Limited
22 # <mst@shadowcatsystems.co.uk>
26 # This work is made available to you under the terms of Version 2 of
27 # the GNU General Public License. A copy of this license can be obtained
28 # from www.gnu.org, or by writing to the Free Software Foundation, Inc.,
29 # 675 Mass Ave, Cambridge, MA 02139, USA.
31 # This work is distributed in the hope that it will be useful, but
32 # WITHOUT ANY WARRANTY; without even the implied warranty of
33 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34 # General Public License for more details.
36 package CPAN::Override;
38 $ENV{PERL_MM_USE_DEFAULT} = 1;
40 my $orig = CPAN::Distribution->can('new');
43 my $dist = $orig->(@_);
44 my @bits = split('-', (split('/', $dist->normalize))[-1]);
46 my $o_pack = join('::', 'CPAN::Override::Distribution', @bits);
47 if ($o_pack->isa('CPAN::Distribution')) {
48 bless($dist, $o_pack);
54 no warnings 'redefine';
55 *CPAN::Distribution::new = \&$replace;
58 package CPAN::Override::Distribution::Template::Toolkit;
60 use base qw/CPAN::Distribution/;
67 my %args = (DOCS => 'n', SPLASH => 'n', EXAMPLES => 'n', EXTRAS => 'n',
68 DBI => 'n', LATEX => 'n', QUIET => 'n', ACCEPT => 'y');
69 my $extra_args = join(' ', map { "TT_$_=".$args{$_} } keys %args);
70 local $CPAN::Config->{makepl_arg} =
71 $CPAN::Config->{makepl_arg}.' '.$extra_args;
72 $self->SUPER::make(@_);
75 package CPAN::Override::Distribution::Module::Install;
77 use base qw/CPAN::Distribution/;
82 my $builddir = $self->dir;
83 chdir($builddir) && (!-f 'Makefile') && do {
84 my $perl = $self->perl;
85 my $re_code = 's/^auto_install_now.*//; s/.*prerequisites_policy.*//;';
86 if ($^O eq 'MSWin32') {
87 $re_code .= ' s/^.*ExtUtils::ParseXS.*$//;';
88 system(qq!$perl -p -i.bak -e "s/\n/\r\n/;" Makefile.PL!);
90 system(qq!$perl -p -i.bak -e "${re_code}" Makefile.PL!);
92 return $self->SUPER::make(@_);
102 if ($^O eq 'MSWin32') {
103 system("ppm install Test-Simple");
104 system("ppm install Spiffy");
105 system("ppm install Test-Base");
106 system("ppm install YAML");
107 system("ppm install UNIVERSAL-require");
108 system("ppm install Module-Pluggable-Fast");
109 system("ppm install Class-Accessor");
110 system("ppm install Test-use-ok");
111 system("ppm install Sub-Uplevel");
112 system("ppm install Test-Exception");
113 system("ppm install UNIVERSAL-isa");
114 system("ppm install UNIVERSAL-can");
115 system("ppm install Test-MockObject");
116 system("ppm install Data-Visitor");
117 system("ppm install Test-Tester");
118 system("ppm install Test-NoWarnings");
119 system("ppm install Scalar-List-Utils");
120 system("ppm install Tree-Simple");
121 system("ppm install Tree-Simple-VisitorFactory");
122 system("ppm install URI");
123 system("ppm install Compress-Zlib");
124 system("ppm install HTML-Tagset");
125 system("ppm install HTML-Parser");
126 system("ppm install libwww-perl");
127 system("ppm install Class-Data-Inheritable");
128 system("ppm install File-Modified");
129 system("ppm install Module-Install");
130 system("ppm install HTTP-Request-AsCGI");
131 system("ppm install HTTP-Body");
132 system("ppm install Text-SimpleTable");
133 system("ppm install MIME-Types");
134 system("ppm install AppConfig");
135 system("ppm install Template-Toolkit");
136 system("ppm install Path-Class");
137 system("ppm install File-Copy-Recursive");
138 system("ppm install Class-Inspector");
139 system("ppm install Catalyst");
140 install('Test::MockObject');