]> git.decadent.org.uk Git - maypole.git/commitdiff
Merge branch 'upstream'
authorBen Hutchings <ben@decadent.org.uk>
Sun, 9 Nov 2008 14:24:57 +0000 (14:24 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 9 Nov 2008 15:12:10 +0000 (15:12 +0000)
14 files changed:
debian/README.Debian [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/libmaypole-perl.docs [new file with mode: 0644]
debian/patches/103_fix-view_object-warning.diff [new file with mode: 0644]
debian/patches/106_fix-_column_info-clash.diff [new file with mode: 0644]
debian/patches/108_fix-uris.diff [new file with mode: 0644]
debian/patches/201_no-file-mmagic-xs.diff [new file with mode: 0644]
debian/patches/202_fix-example-references.diff [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/watch [new file with mode: 0644]

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644 (file)
index 0000000..1d17fe8
--- /dev/null
@@ -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 <ben@decadent.org.uk>, Sun, 16 Sep 2007 19:39:57 +0100
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..89ad210
--- /dev/null
@@ -0,0 +1,52 @@
+maypole (2.13-1) unstable; urgency=low
+
+  * New upstream release - closes: #477210
+    - Obsoletes patches 101, 102, 104, 107, part of 108, 109
+
+ -- Ben Hutchings <ben@decadent.org.uk>  Sun, 15 Jun 2008 14:09:24 +0100
+
+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 <ben@decadent.org.uk>  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 <ben@decadent.org.uk>  Sun, 16 Sep 2007 20:12:12 +0100
+
+maypole (2.10-1) unstable; urgency=low
+
+  * Initial release - closes: #345275
+
+ -- Ben Hutchings <ben@decadentplace.org.uk>  Sat, 31 Dec 2005 14:55:42 +0000
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..870bbc0
--- /dev/null
@@ -0,0 +1,68 @@
+Source: maypole
+Maintainer: Ben Hutchings <ben@decadent.org.uk>
+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 (file)
index 0000000..ba7a4ef
--- /dev/null
@@ -0,0 +1,22 @@
+This is the Debian-packaged version of Maypole, put together by Ben
+Hutchings <ben@decadent.org.uk> using source from:
+
+  http://search.cpan.org/~teejay/Maypole/
+
+Copyright 2005-2006 Simon Cozens <simon@simon-cozens.org> 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 (file)
index 0000000..071e009
--- /dev/null
@@ -0,0 +1,3 @@
+AUTHORS
+examples
+README
diff --git a/debian/patches/103_fix-view_object-warning.diff b/debian/patches/103_fix-view_object-warning.diff
new file mode 100644 (file)
index 0000000..1f6d105
--- /dev/null
@@ -0,0 +1,16 @@
+--- maypole.orig/lib/Maypole.pm
++++ maypole/lib/Maypole.pm
+@@ -496,13 +496,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/106_fix-_column_info-clash.diff b/debian/patches/106_fix-_column_info-clash.diff
new file mode 100644 (file)
index 0000000..0b457f8
--- /dev/null
@@ -0,0 +1,65 @@
+--- maypole.orig/lib/Maypole/Model/CDBI/Base.pm
++++ maypole/lib/Maypole/Model/CDBI/Base.pm
+@@ -460,7 +460,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;
+@@ -572,7 +572,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);
+@@ -609,7 +609,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) {
+@@ -660,7 +660,7 @@
+ sub column_required {
+   my ($class, $colname) = @_;
+   $colname or $class->_croak( "Need a column for column_required" );
+-  $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);
+   }
+@@ -692,7 +692,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);
+   }
+@@ -716,7 +716,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);
+   }
+@@ -750,7 +750,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/108_fix-uris.diff b/debian/patches/108_fix-uris.diff
new file mode 100644 (file)
index 0000000..e3fa3c6
--- /dev/null
@@ -0,0 +1,11 @@
+--- maypole.orig/lib/Maypole/templates/factory/macros
++++ maypole/lib/Maypole/templates/factory/macros
+@@ -18,7 +18,7 @@
+ [%
+ MACRO link(table, command, additional, label, target) BLOCK;
+     SET lnk = base _ "/" _ table _ "/" _ command _ "/" _ additional;
+-    lnk = lnk | uri ;
++    lnk = lnk | html ;
+     IF target ;
+       '<a href="' _ lnk _ '" target="' _ target _'">';
+     ELSE;
diff --git a/debian/patches/201_no-file-mmagic-xs.diff b/debian/patches/201_no-file-mmagic-xs.diff
new file mode 100644 (file)
index 0000000..91f3c0e
--- /dev/null
@@ -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.13';
+-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
+@@ -26,7 +26,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 (file)
index 0000000..88bdefb
--- /dev/null
@@ -0,0 +1,119 @@
+--- maypole.orig/examples/BeerDB.pm
++++ maypole/examples/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);
+--- maypole.orig/examples/fancy_example/BeerDB.pm
++++ maypole/examples/fancy_example/BeerDB.pm
+@@ -14,7 +14,7 @@
+     my $dbi_driver = DBI_DRIVER;
+     if ($dbi_driver =~ /^SQLite/) {
+       unless -e (DATASOURCE) {
+-          die sprintf("SQLite datasource '%s' not found, correct the path or recreate the database by running Makefile.PL", DATASOURCE), "\n";
++          die sprintf("SQLite datasource '%s' not found, correct the path or recreate the database using beerdb.sql", DATASOURCE), "\n";
+       }            
+       eval "require DBD::SQLite";
+         if ($@) {
+@@ -31,8 +31,11 @@
+ BeerDB->config->uri_base( $ENV{BEERDB_BASE} || "http://localhost/beerdb/" );
+ # Change this to the htdoc root for your maypole application.
+-my @root=  ('t/templates');
++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/examples/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);
+--- maypole.orig/lib/Maypole/Manual/About.pod
++++ maypole/lib/Maypole/Manual/About.pod
+@@ -141,15 +141,15 @@
+         notes text
+     );
+-If you have C<DBD::SQLite> 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</usr/share/doc/libmaypole-perl/ex/beerdb.sql> (similar to the
++above).  To use it with SQLite you must change C<auto_increment> to
++C<autoincrement>; with PostgreSQL you must use C<serial>.
++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<www-data>
+ or C<wwwrun>).
+@@ -188,17 +188,29 @@
+         "a pub has beers on handpumps");
+     1;
+-There's a version of this program in the F<examples/> directory in the Maypole
+-files that you downloaded in the F<~root/.cpan/> build area.
+-This defines the C<BeerDB> 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</usr/share/doc/libmaypole-perl/examples/> directory.  This defines the
++C<BeerDB> application.  To set it up as a mod_perl handler:
++
++=over
++
++=item *
++Copy F<BeerDB.pm> and the F<BeerDB/> directory into
++F</usr/local/lib/perl/C<$version>/> or F</usr/local/lib/site_perl/>
++
++=item *
++Set the database path in F<BeerDB.pm>
++
++=item *
++Add the following to the Apache configuration:
+     <Location /beerdb>
+         SetHandler perl-script
+         PerlHandler BeerDB
+     </Location>
++=back
++
+ To use it as a CGI script, put it in your F<cgi-bin> directory,
+ together with a small file called F<beer.cgi>:
+@@ -214,10 +226,8 @@
+ And now we need some templates. As we'll see in the chapter on
+ L<views|Maypole::Manual::View>, there are several types of template.
+-We're going to copy
+-the whole lot from the F<templates/> directory of the Maypole source
+-package into the F</beerdb> directory under our web root.
+-Make the C<template_root> in C<BeerDB> agree with your path.
++These are found in the F</usr/share/doc/libmaypole-perl/examples/templates/>
++directory.
+ And that's it. We should now be able to go to C<http://localhost/beerdb/>
+ or C<http://localhost/cgi-bin/beer.cgi/>
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..dd06d33
--- /dev/null
@@ -0,0 +1,5 @@
+103_fix-view_object-warning.diff
+106_fix-_column_info-clash.diff
+108_fix-uris.diff
+201_no-file-mmagic-xs.diff
+202_fix-example-references.diff
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..4f80aaa
--- /dev/null
@@ -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/examples/templates
+       mv debian/libmaypole-perl/usr/share/doc/libmaypole-perl/templates/beer \
+          debian/libmaypole-perl/usr/share/doc/libmaypole-perl/examples/templates/custom
+       ln -s ../../templates/factory \
+          debian/libmaypole-perl/usr/share/doc/libmaypole-perl/examples/templates/factory
+       ln -s ../../../templates/factory \
+          debian/libmaypole-perl/usr/share/doc/libmaypole-perl/examples/fancy_example/templates/factory
+       dh_compress -X/examples/ -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 (file)
index 0000000..e7e2c2b
--- /dev/null
@@ -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