]> git.decadent.org.uk Git - maypole.git/blob - Makefile.PL
More dependencies.
[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         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,
16         Apache::Request => 0,
17         Template => 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>') : ()),
22 );
23
24 if (!-e "t/beerdb.db") {
25     print "Making SQLite DB\n";
26     require DBD::SQLite;
27     require DBI;
28     my $dbh = DBI->connect("dbi:SQLite:dbname=t/beerdb.db");
29
30     my $sql = join ( '', (<DATA>) );
31
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 $@;
38     }
39 }
40
41 __DATA__
42
43 create table brewery (
44     id int not null auto_increment primary key,
45     name varchar(30),
46     url varchar(50),
47     notes text
48 );
49
50 create table beer (
51     id int not null auto_increment primary key,
52     brewery integer,
53     style integer, 
54     name varchar(30),
55     url varchar(120),
56 #    tasted date,
57     score integer(2),
58     price varchar(12),
59     abv varchar(10),
60     notes text
61 );
62
63 create table handpump (
64     id int not null auto_increment primary key,
65     beer integer,
66     pub integer
67 );
68
69 create table pub (
70     id int not null auto_increment primary key,
71     name varchar(60),
72     url varchar(120),
73     notes text
74 );
75
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);
82