source: trunk/lib/OpenGuides/Build.pm @ 60

Last change on this file since 60 was 60, checked in by kake, 19 years ago

Rejigged in preparation for supporting mysql and sqlite

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 839 bytes
Line 
1package OpenGuides::Build;
2
3use strict;
4use Module::Build;
5use base 'Module::Build';
6
7sub ACTION_install {
8    my $self = shift;
9    $self->SUPER::ACTION_install;
10
11    eval "use Config::Tiny";
12    die "Config::Tiny is required to set up this application.\n" if $@;
13
14    eval "use CGI::Wiki::Setup::Pg";
15    die "CGI::Wiki is required to set up this application.\n" if $@;
16
17    my $config = Config::Tiny->read("wiki.conf");
18    my $dbname = $config->{_}->{dbname};
19    my $dbuser = $config->{_}->{dbuser};
20    my $dbpass = $config->{_}->{dbpass};
21    my $dbhost = $config->{_}->{dbhost};
22
23    print "Checking database schema...\n";
24    CGI::Wiki::Setup::Pg::setup( $dbname, $dbuser, $dbpass, $dbhost );
25}
26
27sub ACTION_fakeinstall {
28    my $self = shift;
29    $self->SUPER::ACTION_fakeinstall;
30    print "Checking database schema...\n";
31}
32
331;
Note: See TracBrowser for help on using the repository browser.