2 use ExtUtils::MakeMaker;
3 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
4 # the contents of the Makefile that is written.
7 VERSION_FROM => 'lib/Apache/MVC.pm', # finds $VERSION
9 DBD::SQLite => 0, # For testing
10 Class::DBI::Loader => 0,
11 Class::DBI::AsForm => 0,
12 Class::DBI::FromCGI => 0,
13 Class::DBI::Loader::Relationship => 0,
14 UNIVERSAL::moniker => 0,
15 UNIVERSAL::require => 0,
18 }, # e.g., Module::Name => 1.1
19 ($] >= 5.005 ? ## Add these new keywords supported since 5.005
20 (ABSTRACT_FROM => 'lib/Apache/MVC.pm', # retrieve abstract from module
21 AUTHOR => 'Simon Cozens <simon@nonet>') : ()),
24 if (!-e "t/beerdb.db") {
25 print "Making SQLite DB\n";
28 my $dbh = DBI->connect("dbi:SQLite:dbname=t/beerdb.db");
30 my $sql = join ( '', (<DATA>) );
32 for my $statement (split /;/, $sql) {
33 $statement =~ s/\#.*$//mg; # strip # comments
34 $statement =~ s/auto_increment//g;
35 next unless $statement =~ /\S/;
36 eval { $dbh->do($statement) };
37 die "$@: $statement" if $@;
43 create table brewery (
44 id int not null auto_increment primary key,
51 id int not null auto_increment primary key,
63 create table handpump (
64 id int not null auto_increment primary key,
70 id int not null auto_increment primary key,
76 INSERT INTO beer (id, brewery, name, abv) VALUES
77 (1, 1, "Organic Best Bitter", "4.1");
78 INSERT INTO brewery (id, name, url) VALUES
79 (1, "St Peter's Brewery", "http://www.stpetersbrewery.co.uk/");
80 INSERT INTO pub (id, name) VALUES (1, "Turf Tavern");
81 INSERT INTO handpump (id, pub, beer) VALUES (1, 1,1);