]> git.decadent.org.uk Git - maypole.git/blob - Makefile.PL
0.2 release.
[maypole.git] / Makefile.PL
1 use 5.006;
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.
5 WriteMakefile(
6     NAME              => 'Apache::MVC',
7     VERSION_FROM      => 'lib/Apache/MVC.pm', # finds $VERSION
8     PREREQ_PM         => {
9         Class::DBI::Loader => 0,
10         Class::DBI::AbstractSearch => 0,
11         Class::DBI::Pager => 0,
12         Class::DBI::Plugin::RetrieveAll => 0,
13         Class::DBI::AsForm => 0,
14         Class::DBI::FromCGI => 0,
15         Class::DBI::Loader::Relationship => 0,
16         CGI::Untaint => 0,
17         UNIVERSAL::moniker => 0,
18         UNIVERSAL::require => 0,
19         Apache::Request => 0,
20         Template => 0,
21     }, # e.g., Module::Name => 1.1
22     ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
23       (ABSTRACT_FROM  => 'lib/Apache/MVC.pm', # retrieve abstract from module
24        AUTHOR         => 'Simon Cozens <simon@nonet>') : ()),
25 );
26
27 if (!-e "t/beerdb.db") {
28     print "Making SQLite DB\n";
29     require DBD::SQLite 
30         or die "No, wait, we don't have SQLite installed. Never mind\n";
31     require DBI;
32     my $dbh = DBI->connect("dbi:SQLite:dbname=t/beerdb.db");
33
34     my $sql = join ( '', (<DATA>) );
35
36     for my $statement (split /;/, $sql) {
37         $statement =~ s/\#.*$//mg; # strip # comments
38         $statement =~ s/auto_increment//g;
39         next unless $statement =~ /\S/;
40         eval { $dbh->do($statement) };
41         die "$@: $statement" if $@;
42     }
43 }
44
45 __DATA__
46
47 create table brewery (
48     id int not null auto_increment primary key,
49     name varchar(30),
50     url varchar(50),
51     notes text
52 );
53
54 create table beer (
55     id int not null auto_increment primary key,
56     brewery integer,
57     style integer, 
58     name varchar(30),
59     url varchar(120),
60 #    tasted date,
61     score integer(2),
62     price varchar(12),
63     abv varchar(10),
64     notes text
65 );
66
67 create table handpump (
68     id int not null auto_increment primary key,
69     beer integer,
70     pub integer
71 );
72
73 create table pub (
74     id int not null auto_increment primary key,
75     name varchar(60),
76     url varchar(120),
77     notes text
78 );
79
80 INSERT INTO beer (id, brewery, name, abv) VALUES
81     (1, 1, "Organic Best Bitter", "4.1");
82 INSERT INTO brewery (id, name, url) VALUES
83     (1, "St Peter's Brewery", "http://www.stpetersbrewery.co.uk/");
84 INSERT INTO pub (id, name) VALUES (1, "Turf Tavern");
85 INSERT INTO handpump (id, pub, beer) VALUES (1, 1,1);
86