CGI-Wiki-Kwiki

 view release on metacpan or  search on metacpan

bin/cgi-wiki-kwiki-install  view on Meta::CPAN

my (undef, $path, undef) = File::Spec->splitpath($INC{'CGI/Wiki/Kwiki.pm'});
my $templates = File::Spec->catfile( $path, "Kwiki", "templates" );
die "Can't find CGI::Wiki::Kwiki's templates in '$path'"
  unless (-d $templates);

print "Installing CGI::Wiki::Kwiki...\n";

print "  installing cgi script\n";
copy($script, $target) or die "Can't install CGI script - $!\n";

chmod(0755, $target) or die "Can't make CGI script executable - $!\n";

print "  Installing templates to ./templates\n";
mkdir "templates";
opendir TEMPLATES, $templates or die "Can't open template source folder: $!\n";
for (grep { /\.(tt|css)$/ } readdir(TEMPLATES)) {
  print "    installing template $_\n";
  File::Copy::copy(
    File::Spec->catfile($templates, $_),
    File::Spec->catfile("templates", $_ )
  ) or die "Error copying $_: $!\n";
}
closedir(TEMPLATES);

print "  setting up DB\n";
system($setup, qw( --type sqlite --name wikidb )) and die "Can't set up DB\n";
chmod(0666, "wikidb") or die "Can't make database writable by all users\n";

print "CGI::Wiki::Kwiki is now installed in the current directory\n";
print "Edit the script $target to set options\n";


# little utility function to find a script and make sure it's +x, etc.
sub find_script {
  my $name = shift;

  # for preference, we find files in the same dir as us. Really handy



( run in 0.225 second using v1.01-cache-2.11-cpan-496ff517765 )