#!/usr/bin/perl use strict; use SVN::Web; use Config; use File::Copy; use File::Basename; die "already have config.yaml" if -e 'config.yaml'; open my $fh, ">config.yaml"; for (@SVN::Web::PLUGINS) { my $module = $_; s/^(\w)/\U$1/; print $fh lc(${module}).'_class:'.(' 'x(20-(length $_)))."SVN::Web::$_\n"; } my %targets = ( Template => 'template', I18N => 'po', Style => 'css', ); while (my ($from, $to) = each %targets) { my $path = $INC{'SVN/Web.pm'}; $path =~ s{.pm$}{/$from}i or next; mkdir $to; copy($_ => "$to/".basename($_)) for glob("$path/*"); } print $fh <index.cgi'; print $fh <<"END"; $Config::Config{startperl} -w #use lib '.'; #use lib '../lib'; use SVN::Web; SVN::Web::run_cgi(); END close $fh; chmod 0755,'index.cgi'; # XXX: export the template too print "SVN::Web now installed! please see config.yaml\n";