From b9be8a0a021acc1176dbb43b43fb48d6cf9dc151 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 16 Sep 2007 19:16:21 +0000 Subject: [PATCH] Added patch to adjust examples and tutorial for use in the package. --- .../patches/202_fix-example-references.diff | 120 ++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 121 insertions(+) create mode 100644 debian/patches/202_fix-example-references.diff 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 index efe0375..a1a022d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,3 +7,4 @@ 107_make-examples-consistent.diff 108_fix-uris.diff 201_no-file-mmagic-xs.diff +202_fix-example-references.diff -- 2.39.5