]> git.decadent.org.uk Git - maypole.git/blob - Makefile.PL
This is very close to being able to spit out pages now.
[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         Apache::Request => 0,
12         Template => 0,
13     }, # e.g., Module::Name => 1.1
14     ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
15       (ABSTRACT_FROM  => 'lib/Apache/MVC.pm', # retrieve abstract from module
16        AUTHOR         => 'Simon Cozens <simon@nonet>') : ()),
17 );
18
19 if (!-e "t/beerdb.db") {
20     print "Making SQLite DB\n";
21     require DBD::SQLite;
22     require DBI;
23     my $dbh = DBI->connect("dbi:SQLite:dbname=t/beerdb.db");
24
25     my $sql = join ( '', (<DATA>) );
26
27     for my $statement (split /;/, $sql) {
28         $statement =~ s/\#.*$//mg; # strip # comments
29         $statement =~ s/auto_increment//g;
30         next unless $statement =~ /\S/;
31         eval { $dbh->do($statement) };
32         die "$@: $statement" if $@;
33     }
34 }
35
36 __DATA__
37
38 create table brewery (
39     id int not null auto_increment primary key,
40     name varchar(30),
41     url varchar(50),
42     notes text
43 );
44
45 create table beer (
46     id int not null auto_increment primary key,
47     brewery integer,
48     style integer, 
49     name varchar(30),
50     url varchar(120),
51 #    tasted date,
52     score integer(2),
53     price varchar(12),
54     abv varchar(10),
55     notes text
56 );
57
58 create table handpump (
59     id int not null auto_increment primary key,
60     beer integer,
61     pub integer
62 );
63
64 create table pub (
65     id int not null auto_increment primary key,
66     name varchar(60),
67     url varchar(120),
68     notes text
69 );
70
71 INSERT INTO beer (id, brewery, name, abv) VALUES
72     (1, 1, "Organic Best Bitter", "4.1");
73 INSERT INTO brewery (id, name, url) VALUES
74     (1, "St Peter's Brewery", "http://www.stpetersbrewery.co.uk/");
75 INSERT INTO pub (id, name) VALUES (1, "Turf Tavern");
76 INSERT INTO handpump (id, pub, beer) VALUES (1, 1,1);
77