From: Ben Hutchings Date: Tue, 4 Nov 2008 03:34:39 +0000 (+0000) Subject: Merge commit '2.13' into HEAD X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=fadcae3ffddebaa38da172f9624cc60176d80b33;hp=213b0e139beb727fa7ef1ba757b41a00cf8437f7;p=maypole.git Merge commit '2.13' into HEAD --- diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..1d17fe8 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,9 @@ +To use Maypole with mod_perl, you must install libapache2-mod-perl2 +and libapache2-request-perl. You must also enable mod_perl and +mod_apreq: + + # a2enmod perl + # a2enmod apreq + # /etc/init.d/apache2 force-reload + + -- Ben Hutchings , Sun, 16 Sep 2007 19:39:57 +0100 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..eb71d58 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,45 @@ +maypole (2.11+2.111-2) unstable; urgency=low + + * Added clone handling to improve compatibility with Apache's + multithreaded MPMs (109_handle-clone.diff) + + -- Ben Hutchings Sun, 16 Sep 2007 23:59:29 +0100 + +maypole (2.11+2.111-1) unstable; urgency=low + + * New upstream version + - Includes templates within examples - closes: #409324 + * Updated my email address + * Removed dependency on libapache-request-perl and recommendation of + libapache-mod-perl - closes: #432463 + * Removed dependency of new upstream version on File::MMagic::XS + pending packaging of that (201_no-file-mmagic-xs.diff) + * Fixed minimum length of file extension for file type inference + (101_fix-extension-mime-type.diff) + * Fixed apache_mvc test to work with Apache2 modules + (102_fix-apache_mvc-test.diff) + * Removed subroutine definition which is replaced at run-time and + otherwise results in a warning (103_fix-view_object-warning.diff) + * Added watch file + * Added md5sums + * Updated policy version to 3.7.2 (no other changes required). + * Added error propagation through CGI front-end + (104_add-cgi-error-status.diff) + * Fixed reporting of template warnings (105_dont-use-warn-method.diff) + * Fixed method name clash with Class::DBI::mysql + (106_fix-_column_info-clash.diff) + * Fixed some inconsistencies between examples and tutorial + (107_make-examples-consistent.diff) + * Fixed generation of some URIs in standard templates (108_fix-uris.diff) + * Adjusted examples and tutorial for use in the package + (202_fix-example-references.diff) + * Added README.Debian explaining use with Debian Apache/mod_perl + packages + + -- Ben Hutchings Sun, 16 Sep 2007 20:12:12 +0100 + +maypole (2.10-1) unstable; urgency=low + + * Initial release - closes: #345275 + + -- Ben Hutchings Sat, 31 Dec 2005 14:55:42 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +4 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..54b8f94 --- /dev/null +++ b/debian/control @@ -0,0 +1,69 @@ +Source: maypole +Maintainer: Ben Hutchings +Section: perl +Priority: extra +Build-Depends: debhelper (>= 5), quilt +Build-Depends-Indep: perl (>= 5.6.0-16), + libclass-dbi-abstractsearch-perl, + libclass-dbi-pager-perl, + libclass-dbi-plugin-retrieveall-perl, + libclass-dbi-loader-relationship-perl, + libclass-dbi-perl, + libclass-dbi-sqlite-perl, + libcgi-untaint-perl (>= 1.26), + libcgi-untaint-date-perl, + libcgi-untaint-email-perl, + libuniversal-moniker-perl, + libuniversal-require-perl, + liburi-perl, + libcgi-simple-perl, + libhttp-body-perl, + libhtml-tree-perl, + libwww-perl, + libtemplate-perl, + libtemplate-plugin-class-perl, + libtest-mockmodule-perl, + libdigest-perl, + libfile-mmagic-perl, + libclass-dbi-plugin-type-perl, + libclass-accessor-perl, + libclass-data-inheritable-perl, + libtest-pod-perl, + libtest-pod-coverage-perl, + libapache2-request-perl +Standards-Version: 3.7.2 + +Package: libmaypole-perl +Architecture: all +Depends: ${perl:Depends}, + libclass-dbi-abstractsearch-perl, + libclass-dbi-pager-perl, + libclass-dbi-plugin-retrieveall-perl, + libclass-dbi-loader-relationship-perl, + libclass-dbi-perl, + libclass-dbi-sqlite-perl, + libcgi-untaint-perl (>= 1.26), + libcgi-untaint-date-perl, + libcgi-untaint-email-perl, + libuniversal-moniker-perl, + libuniversal-require-perl, + liburi-perl, + libcgi-simple-perl, + libhttp-body-perl, + libhtml-tree-perl, + libwww-perl, + libtemplate-perl, + libtemplate-plugin-class-perl, + libtest-mockmodule-perl, + libdigest-perl, + libfile-mmagic-perl, + libclass-dbi-plugin-type-perl +Recommends: libapache2-mod-perl2 +Description: Perl framework for MVC-oriented web applications + Maypole is a Perl framework for Model/View/Controller-oriented web + applications, similar to Jakarta's Struts. Maypole is designed to + minimize coding requirements for creating simple web interfaces to + databases, while remaining flexible enough to support enterprise web + applications. + . + Homepage: http://maypole.perl.org/ diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ba7a4ef --- /dev/null +++ b/debian/copyright @@ -0,0 +1,22 @@ +This is the Debian-packaged version of Maypole, put together by Ben +Hutchings using source from: + + http://search.cpan.org/~teejay/Maypole/ + +Copyright 2005-2006 Simon Cozens et al. +(See list of authors in `/usr/share/doc/libmaypole-perl/AUTHORS'.) + +You may distribute this code under the same terms as Perl itself: + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + a) the GNU General Public License as published by the Free Software + Foundation; either version 1, or (at your option) any later + version, or + + b) the "Artistic License" which comes with Perl. + +On Debian systems, the complete text of the GNU General Public License +can be found in `/usr/share/common-licenses/GPL' and the Artistic +Licence in `/usr/share/common-licenses/Artistic'. diff --git a/debian/libmaypole-perl.docs b/debian/libmaypole-perl.docs new file mode 100644 index 0000000..574a5d0 --- /dev/null +++ b/debian/libmaypole-perl.docs @@ -0,0 +1,3 @@ +AUTHORS +ex +README diff --git a/debian/patches/101_fix-extension-mime-type.diff b/debian/patches/101_fix-extension-mime-type.diff new file mode 100644 index 0000000..e8c1022 --- /dev/null +++ b/debian/patches/101_fix-extension-mime-type.diff @@ -0,0 +1,11 @@ +--- maypole.orig/lib/Maypole.pm ++++ maypole/lib/Maypole.pm +@@ -617,7 +617,7 @@ + sub __get_mime_type { + my $self = shift; + my $type = 'text/html'; +- if ($self->path =~ m/.*\.(\w{3,4})$/) { ++ if ($self->path =~ m/.*\.(\w{2,4})$/) { + $type = $filetypes{$1}; + } else { + my $output = $self->output; diff --git a/debian/patches/102_fix-apache_mvc-test.diff b/debian/patches/102_fix-apache_mvc-test.diff new file mode 100644 index 0000000..db9a4fa --- /dev/null +++ b/debian/patches/102_fix-apache_mvc-test.diff @@ -0,0 +1,18 @@ +--- maypole.orig/t/apache_mvc.t ++++ maypole/t/apache_mvc.t +@@ -2,10 +2,13 @@ + use strict; + use Test::More; + BEGIN { +- if (eval { require Apache::Request }) { ++ if (eval { require Apache2::RequestRec }) { ++ $ENV{MOD_PERL_API_VERSION} = 2; ++ plan tests => 3; ++ } elsif (eval { require Apache::Request }) { + plan tests => 3; + } else { +- Test::More->import(skip_all =>"Apache::Request is not installed: $@"); ++ Test::More->import(skip_all =>"Neither Apache2::RequestRec nor Apache::Request is installed: $@"); + } + } + diff --git a/debian/patches/103_fix-view_object-warning.diff b/debian/patches/103_fix-view_object-warning.diff new file mode 100644 index 0000000..34d1a1d --- /dev/null +++ b/debian/patches/103_fix-view_object-warning.diff @@ -0,0 +1,16 @@ +--- maypole.orig/lib/Maypole.pm ++++ maypole/lib/Maypole.pm +@@ -495,13 +495,6 @@ + return $self->NEXT::DISTINCT::get_template_root( $r, @_ ); + } + +-sub view_object { +- my $self = shift; +- my $r = shift; +- return $r->parent->view_object if $r->{parent}; +- return $self->NEXT::DISTINCT::view_object( $r, @_ ); +-} +- + # Instead of making plugin authors use the NEXT::DISTINCT hoopla to ensure other + # plugins also get to call the hook, we can cycle through the application's + # @ISA and call them all here. Doesn't work for setup() though, because it's diff --git a/debian/patches/104_add-cgi-error-status.diff b/debian/patches/104_add-cgi-error-status.diff new file mode 100644 index 0000000..7fdef73 --- /dev/null +++ b/debian/patches/104_add-cgi-error-status.diff @@ -0,0 +1,21 @@ +--- maypole.orig/lib/CGI/Maypole.pm ++++ maypole/lib/CGI/Maypole.pm +@@ -57,7 +57,17 @@ + sub run + { + my $self = shift; +- return $self->handler; ++ my $status = $self->handler; ++ if ($status != OK) { ++ print <Maypole application error ++

Maypole application error

++EOT ++ } ++ return $status; + } + + =head1 Implementation diff --git a/debian/patches/105_dont-use-warn-method.diff b/debian/patches/105_dont-use-warn-method.diff new file mode 100644 index 0000000..366c488 --- /dev/null +++ b/debian/patches/105_dont-use-warn-method.diff @@ -0,0 +1,31 @@ +--- maypole.orig/lib/Maypole/View/TT.pm ++++ maypole/lib/Maypole/View/TT.pm +@@ -43,11 +43,11 @@ + } else { + if ($@) { + my $error = "fatal error in template '$template_file' : $@\nTT paths : " . join(', ',$self->paths($r)) . "\n"; +- $r->warn($error); ++ warn $error; + $r->{error} = $error; + } else { + my $error = "TT error for template '$template_file'\n" . $self->{tt}->error . "\nTT paths : " . join(', ',$self->paths($r)) . "\n"; +- $r->warn($error); ++ warn $error; + $r->{error} = $error; + } + return ERROR; +@@ -62,12 +62,12 @@ + # Need to be very careful here. + my $tt = Template->new; + unless (ref $r->{config}) { +- $r->warn("no config for this request"); ++ warn "no config for this request"; + $error .= '
There was a problem finding configuration for this request'; + $r->{config} ||= {}; + } + +- $r->warn("report_error - reporting error to user : $error\n"); ++ warn "report_error - reporting error to user : $error\n"; + + if ($tt->process(\$error_template, + { err_type => $type, error => $error, diff --git a/debian/patches/106_fix-_column_info-clash.diff b/debian/patches/106_fix-_column_info-clash.diff new file mode 100644 index 0000000..430f254 --- /dev/null +++ b/debian/patches/106_fix-_column_info-clash.diff @@ -0,0 +1,65 @@ +--- maypole.orig/lib/Maypole/Model/CDBI.pm ++++ maypole/lib/Maypole/Model/CDBI.pm +@@ -503,7 +503,7 @@ + + # Thanks to dave baird -- form builder for these private functions + # sub _column_info { +-sub _column_info { ++sub _init_column_info { + my $self = shift; + my $dbh = $self->db_Main; + +@@ -615,7 +615,7 @@ + sub column_type { + my $class = shift; + my $colname = shift or die "Need a column for column_type"; +- $class->_column_info() unless (ref $class->COLUMN_INFO); ++ $class->_init_column_info() unless (ref $class->COLUMN_INFO); + + if ($class->_isa_class($colname)) { + return $class->_isa_class($colname)->column_type($colname); +@@ -646,7 +646,7 @@ + + sub required_columns { + my ($class, $columns) = @_; +- $class->_column_info() unless ref $class->COLUMN_INFO; ++ $class->_init_column_info() unless ref $class->COLUMN_INFO; + my $column_info = $class->COLUMN_INFO; + + if ($columns) { +@@ -683,7 +683,7 @@ + sub column_required { + my ($class, $colname) = @_; + $colname or $class->_croak( "Need a column for column_nullable" ); +- $class->_column_info() unless ref $class->COLUMN_INFO; ++ $class->_init_column_info() unless ref $class->COLUMN_INFO; + if ($class->_isa_class($colname)) { + return $class->_isa_class($colname)->column_required($colname); + } +@@ -714,7 +714,7 @@ + my $class = shift; + my $colname = shift or $class->_croak( "Need a column for column_nullable" ); + +- $class->_column_info() unless ref $class->COLUMN_INFO; ++ $class->_init_column_info() unless ref $class->COLUMN_INFO; + if ($class->_isa_class($colname)) { + return $class->_isa_class($colname)->column_nullable($colname); + } +@@ -737,7 +737,7 @@ + sub column_default { + my $class = shift; + my $colname = shift or $class->_croak( "Need a column for column_default"); +- $class->_column_info() unless (ref $class->COLUMN_INFO); ++ $class->_init_column_info() unless (ref $class->COLUMN_INFO); + if ($class->_isa_class($colname)) { + return $class->_isa_class($colname)->column_default($colname); + } +@@ -770,7 +770,7 @@ + $res{moniker} = $class->moniker; + $res{plural} = $class->plural_moniker; + $res{table} = $class->table; +- $res{column_metadata} = (ref $class->COLUMN_INFO) ? $class->COLUMN_INFO : $class->_column_info() ; ++ $res{column_metadata} = (ref $class->COLUMN_INFO) ? $class->COLUMN_INFO : $class->_init_column_info() ; + return \%res; + } + diff --git a/debian/patches/107_make-examples-consistent.diff b/debian/patches/107_make-examples-consistent.diff new file mode 100644 index 0000000..1761627 --- /dev/null +++ b/debian/patches/107_make-examples-consistent.diff @@ -0,0 +1,160 @@ +--- trunk.orig/ex/fancy_example/BeerDB.pm ++++ trunk/ex/fancy_example/BeerDB.pm +@@ -6,11 +6,23 @@ + # This is the sample application. Change this to the path to your + # database. (or use mysql or something) + use constant DBI_DRIVER => 'SQLite'; +-use constant DATASOURCE => '/home/peter/Desktop/maypolebeer/beerdb'; ++use constant DATASOURCE => $ENV{BEERDB_DATASOURCE} || 't/beerdb.db'; + + BeerDB->config->model('BeerDB::Base'); + +-BeerDB->setup("dbi:mysql:beerdb",'root', ''); ++BEGIN { ++ my $dbi_driver = DBI_DRIVER; ++ if ($dbi_driver =~ /^SQLite/) { ++ die sprintf "SQLite datasource '%s' not found, correct the path or " ++ . "recreate the database by running Makefile.PL", DATASOURCE ++ unless -e DATASOURCE; ++ eval "require DBD::SQLite"; ++ if ($@) { ++ eval "require DBD::SQLite2" and $dbi_driver = 'SQLite2'; ++ } ++ } ++ BeerDB->setup(join ':', "dbi", $dbi_driver, DATASOURCE); ++} + + # Give it a name. + BeerDB->config->application_name('The Beer Database'); +@@ -20,7 +32,7 @@ + + # Change this to the htdoc root for your maypole application. + +-my @root= ('/home/peter/Desktop/maypolebeer/templates'); ++my @root= ('t/templates'); + push @root,$ENV{BEERDB_TEMPLATE_ROOT} if ($ENV{BEERDB_TEMPLATE_ROOT}); + BeerDB->config->template_root( [@root] ); + # Specify the rows per page in search results, lists, etc : 10 is a nice round number +@@ -37,7 +49,7 @@ + BeerDB::Brewery->untaint_columns( printable => [qw/name notes url/] ); + BeerDB::Style->untaint_columns( printable => [qw/name notes/] ); + BeerDB::Beer->untaint_columns( +- printable => [qw/abv name price notes/], ++ printable => [qw/abv name price notes url/], + integer => [qw/style brewery score/], + date =>[ qw/tasted/], + ); +@@ -47,7 +59,7 @@ + + + # Required Fields +-BeerDB->config->{brewery}{required_cols} = [qw/name url/]; ++BeerDB->config->{brewery}{required_cols} = [qw/name/]; + BeerDB->config->{style}{required_cols} = [qw/name/]; + BeerDB->config->{beer}{required_cols} = [qw/brewery name price/]; + BeerDB->config->{pub}{required_cols} = [qw/name/]; +@@ -67,7 +79,7 @@ + + # For testing classmetadata + #sub BeerDB::Beer::classdata :Exported {}; +-sub BeerDB::Beer::list_columns { return qw/score name price style brewery/}; ++sub BeerDB::Beer::list_columns { return qw/score name price style brewery url/}; + + sub BeerDB::Handpump::stringify_self { + my $self = shift; +--- trunk.orig/ex/fancy_example/beerdb.sql ++++ trunk/ex/fancy_example/beerdb.sql +@@ -1,27 +1,28 @@ + CREATE TABLE style ( +- id integer primary key auto_increment, ++ id integer not null primary key auto_increment, + name varchar(60), + notes text + ); + + CREATE TABLE pub ( +- id integer primary key auto_increment, ++ id integer not null primary key auto_increment, + name varchar(60), + url varchar(120), + notes text + ); + + CREATE TABLE handpump ( +- id integer primary key auto_increment, ++ id integer not null primary key auto_increment, + beer integer, + pub integer + ); + + CREATE TABLE beer ( +- id integer primary key auto_increment, ++ id integer not null primary key auto_increment, + brewery integer, + style integer, + name varchar(30), ++ url varchar(120), + score integer(2), + price varchar(12), + abv varchar(10), +@@ -30,7 +31,7 @@ + ); + + CREATE TABLE brewery ( +- id integer primary key auto_increment, ++ id integer not null primary key auto_increment, + name varchar(30), + url varchar(50), + notes text +--- trunk.orig/lib/Maypole/Manual/About.pod ++++ trunk/lib/Maypole/Manual/About.pod +@@ -119,7 +119,8 @@ + score integer(2), + price varchar(12), + abv varchar(10), +- notes text ++ notes text, ++ tasted date + ); + + create table handpump ( +--- trunk.orig/ex/beerdb.sql ++++ trunk/ex/beerdb.sql +@@ -1,24 +1,24 @@ + CREATE TABLE style ( +- id integer primary key auto_increment, ++ id integer not null primary key auto_increment, + name varchar(60), + notes text + ); + + CREATE TABLE pub ( +- id integer primary key auto_increment, ++ id integer not null primary key auto_increment, + name varchar(60), + url varchar(120), + notes text + ); + + CREATE TABLE handpump ( +- id integer primary key auto_increment, ++ id integer not null primary key auto_increment, + beer integer, + pub integer + ); + + CREATE TABLE beer ( +- id integer primary key auto_increment, ++ id integer not null primary key auto_increment, + brewery integer, + style integer, + name varchar(30), +@@ -31,7 +31,7 @@ + ); + + CREATE TABLE brewery ( +- id integer primary key auto_increment, ++ id integer not null primary key auto_increment, + name varchar(30), + url varchar(50), + notes text diff --git a/debian/patches/108_fix-uris.diff b/debian/patches/108_fix-uris.diff new file mode 100644 index 0000000..a3ffc60 --- /dev/null +++ b/debian/patches/108_fix-uris.diff @@ -0,0 +1,22 @@ +--- trunk.orig/lib/Maypole/templates/factory/macros ++++ trunk/lib/Maypole/templates/factory/macros +@@ -14,7 +14,7 @@ + [% + MACRO link(table, command, additional, label) BLOCK; + SET lnk = base _ "/" _ table _ "/" _ command _ "/" _ additional; +- lnk = lnk | uri ; ++ lnk = lnk | html ; + ''; + label | html; + ""; +--- trunk.orig/lib/Maypole/templates/factory/header ++++ trunk/lib/Maypole/templates/factory/header +@@ -10,7 +10,7 @@ + + + +- ++ + + +
diff --git a/debian/patches/109_handle-clone.diff b/debian/patches/109_handle-clone.diff new file mode 100644 index 0000000..70258d5 --- /dev/null +++ b/debian/patches/109_handle-clone.diff @@ -0,0 +1,28 @@ +--- trunk.orig/lib/Maypole/Model/Base.pm ++++ trunk/lib/Maypole/Model/Base.pm +@@ -12,14 +12,23 @@ + shift; # class name not used + my ($coderef, @attrs) = @_; + +- $remember{$coderef} = \@attrs; ++ $remember{$coderef} = [$coderef, \@attrs]; + + # previous version took care to return an empty array, not sure why, + # but shall cargo cult it until know better + return; + } + +-sub FETCH_CODE_ATTRIBUTES { @{ $remember{$_[1]} || [] } } ++sub FETCH_CODE_ATTRIBUTES { @{ $remember{$_[1]}->[1] || [] } } ++ ++sub CLONE { ++ # re-hash %remember ++ for my $key (keys %remember) { ++ my $value = delete $remember{$key}; ++ $key = $value->[0]; ++ $remember{$key} = $value; ++ } ++} + + sub process { + my ( $class, $r ) = @_; diff --git a/debian/patches/201_no-file-mmagic-xs.diff b/debian/patches/201_no-file-mmagic-xs.diff new file mode 100644 index 0000000..5383e73 --- /dev/null +++ b/debian/patches/201_no-file-mmagic-xs.diff @@ -0,0 +1,26 @@ +--- maypole.orig/lib/Maypole.pm ++++ maypole/lib/Maypole.pm +@@ -10,10 +10,10 @@ + use URI(); + use URI::QueryParam; + use NEXT; +-use File::MMagic::XS qw(:compat); ++use File::MMagic; + + our $VERSION = '2.111'; +-our $mmagic = File::MMagic::XS->new(); ++our $mmagic = File::MMagic->new(); + + # proposed privacy conventions: + # - no leading underscore - public to custom application code and plugins +--- maypole.orig/Makefile.PL ++++ maypole/Makefile.PL +@@ -29,7 +29,7 @@ + Template::Plugin::Class => 0, + Test::MockModule => 0, + Digest::MD5 => 0, +- File::MMagic::XS => 0.08, ++ File::MMagic => 1.21, + Class::DBI::Plugin::Type => 0, + }, # e.g., Module::Name => 1.1 + ( diff --git a/debian/patches/202_fix-example-references.diff b/debian/patches/202_fix-example-references.diff new file mode 100644 index 0000000..e35ec87 --- /dev/null +++ b/debian/patches/202_fix-example-references.diff @@ -0,0 +1,120 @@ +--- trunk.orig/ex/BeerDB.pm ++++ trunk/ex/BeerDB.pm +@@ -13,7 +13,7 @@ + my $dbi_driver = DBI_DRIVER; + if ($dbi_driver =~ /^SQLite/) { + die sprintf "SQLite datasource '%s' not found, correct the path or " +- . "recreate the database by running Makefile.PL", DATASOURCE ++ . "recreate the database using beerdb.sql", DATASOURCE + unless -e DATASOURCE; + eval "require DBD::SQLite"; + if ($@) { +@@ -31,8 +31,10 @@ + + # Change this to the htdoc root for your maypole application. + +-my @root= ('t/templates'); +-push @root,$ENV{BEERDB_TEMPLATE_ROOT} if ($ENV{BEERDB_TEMPLATE_ROOT}); ++my @root; ++push @root, 't/templates' if (-d 't/templates'); ++push @root, $ENV{BEERDB_TEMPLATE_ROOT} if ($ENV{BEERDB_TEMPLATE_ROOT}); ++push @root, '/usr/share/doc/libmaypole-perl/ex/templates' unless @root; + BeerDB->config->template_root( [@root] ); + # Specify the rows per page in search results, lists, etc : 10 is a nice round number + BeerDB->config->rows_per_page(10); +--- trunk.orig/ex/fancy_example/BeerDB.pm ++++ trunk/ex/fancy_example/BeerDB.pm +@@ -14,7 +14,7 @@ + my $dbi_driver = DBI_DRIVER; + if ($dbi_driver =~ /^SQLite/) { + die sprintf "SQLite datasource '%s' not found, correct the path or " +- . "recreate the database by running Makefile.PL", DATASOURCE ++ . "recreate the database using beerdb.sql", DATASOURCE + unless -e DATASOURCE; + eval "require DBD::SQLite"; + if ($@) { +@@ -32,8 +32,11 @@ + + # Change this to the htdoc root for your maypole application. + +-my @root= ('t/templates'); +-push @root,$ENV{BEERDB_TEMPLATE_ROOT} if ($ENV{BEERDB_TEMPLATE_ROOT}); ++my @root; ++push @root, 't/templates' if (-d 't/templates'); ++push @root, $ENV{BEERDB_TEMPLATE_ROOT} if ($ENV{BEERDB_TEMPLATE_ROOT}); ++push @root, '/usr/share/doc/libmaypole-perl/ex/fancy_example/templates' ++ unless @root; + BeerDB->config->template_root( [@root] ); + # Specify the rows per page in search results, lists, etc : 10 is a nice round number + BeerDB->config->rows_per_page(10); +--- trunk.orig/lib/Maypole/Manual/About.pod ++++ trunk/lib/Maypole/Manual/About.pod +@@ -142,15 +142,15 @@ + notes text + ); + +-If you have C available, then a database like this will +-be created when Maypole was installed. Let's now see how to set it up +-with a web interface. +- + =head2 Setting up Maypole + + The first thing we need for a Maypole interface to a database is to + have a database. If you don't have one, now would be a good time to +-create one, using the schema above. If you're creating a database ++create one, using the schema in ++F (similar to the ++above). To use it with SQLite you must change C to ++C; with PostgreSQL you must use C. ++If you're creating a database + by hand, don't forget to grant permissions for your Apache server to + access it as well as yourself (typically a user name like C + or C). +@@ -189,17 +189,29 @@ + "a pub has beers on handpumps"); + 1; + +-There's a version of this program in the F directory in the Maypole +-files that you downloaded in the F<~root/.cpan/> build area. +-This defines the C application. +-To set it up as a mod_perl handler, just tell the Apache configuration +-about it: ++There's a version of this program in the ++F directory. This defines the ++C application. To set it up as a mod_perl handler: ++ ++=over ++ ++=item * ++Copy F and the F directory into ++F/> or F ++ ++=item * ++Set the database path in F ++ ++=item * ++Add the following to the Apache configuration: + + + SetHandler perl-script + PerlHandler BeerDB + + ++=back ++ + To use it as a CGI script, put it in your F directory, + together with a small file called F: + +@@ -215,10 +227,8 @@ + + And now we need some templates. As we'll see in the chapter on + L, there are several types of template. +-We're going to copy +-the whole lot from the F directory of the Maypole source +-package into the F directory under our web root. +-Make the C in C agree with your path. ++These are found in the F ++directory. + + And that's it. We should now be able to go to C + or C diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..6419a25 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,11 @@ +101_fix-extension-mime-type.diff +102_fix-apache_mvc-test.diff +103_fix-view_object-warning.diff +104_add-cgi-error-status.diff +105_dont-use-warn-method.diff +106_fix-_column_info-clash.diff +107_make-examples-consistent.diff +108_fix-uris.diff +109_handle-clone.diff +201_no-file-mmagic-xs.diff +202_fix-example-references.diff diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..8352dba --- /dev/null +++ b/debian/rules @@ -0,0 +1,41 @@ +#!/usr/bin/make -f + +include /usr/share/quilt/quilt.make + +build : build-stamp + +build-stamp : Makefile.PL $(QUILT_STAMPFN) + perl Makefile.PL INSTALLDIRS=vendor + $(MAKE) test + touch build-stamp + +binary : binary-arch binary-indep + +binary-arch : + +binary-indep : build-stamp + dh_testroot + $(MAKE) PREFIX=$(CURDIR)/debian/libmaypole-perl/usr install + dh_perl + dh_installchangelogs Changes + dh_installdocs + mv debian/libmaypole-perl/usr/share/perl5/Maypole/templates \ + debian/libmaypole-perl/usr/share/doc/libmaypole-perl/templates + mkdir debian/libmaypole-perl/usr/share/doc/libmaypole-perl/ex/templates + mv debian/libmaypole-perl/usr/share/doc/libmaypole-perl/templates/beer \ + debian/libmaypole-perl/usr/share/doc/libmaypole-perl/ex/templates/custom + ln -s ../../templates/factory \ + debian/libmaypole-perl/usr/share/doc/libmaypole-perl/ex/templates/factory + ln -s ../../../templates/factory \ + debian/libmaypole-perl/usr/share/doc/libmaypole-perl/ex/fancy_example/templates/factory + dh_compress -X/ex/ -X/templates/ + dh_fixperms + dh_gencontrol + dh_md5sums + dh_builddeb + +clean : unpatch + if [ -f Makefile ]; then $(MAKE) clean; fi + dh_clean Makefile Makefile.old build-stamp + +.PHONY : build binary binary-arch binary-dep clean patch unpatch diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..e7e2c2b --- /dev/null +++ b/debian/watch @@ -0,0 +1,7 @@ +version=3 +# Versions appear to be decimal, so when there are three digits in the +# minor number prepend the version truncated to two minor digits. +# Change pre-release versions to Debian format. +opts="uversionmangle=s/^(\d+\.\d\d)\d(?:_|$)/$1+$&/; s/_pre/~pre/" \ +http://search.cpan.org/~teejay/Maypole/ \ +/CPAN/authors/id/T/TE/TEEJAY/Maypole-([\w.]+)\.tar\.gz