summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsno <sno@pkgsrc.org>2009-06-14 22:42:57 +0000
committersno <sno@pkgsrc.org>2009-06-14 22:42:57 +0000
commit17f5a2611178cdd14334a6e590c44b27a3a0e30f (patch)
tree51c3ac5adb483481f652399888c0265cbc3b17ea
parent7210d193c97b8ae7b616e6720ae6261103f9d933 (diff)
downloadpkgsrc-17f5a2611178cdd14334a6e590c44b27a3a0e30f.tar.gz
Importing package of p5 module Template::Plugin::DBI 2.64.
This Template Toolkit plugin module provides an interface to the Perl DBI/DBD modules, allowing to integrate SQL queries into template documents. It also provides an interface via the Tie::DBI module (if installed) so that database records can be accessed without having to embed any SQL in templates.
-rw-r--r--databases/p5-Template-DBI/DESCR4
-rw-r--r--databases/p5-Template-DBI/Makefile24
-rw-r--r--databases/p5-Template-DBI/distinfo6
-rw-r--r--databases/p5-Template-DBI/patches/patch-aa134
4 files changed, 168 insertions, 0 deletions
diff --git a/databases/p5-Template-DBI/DESCR b/databases/p5-Template-DBI/DESCR
new file mode 100644
index 00000000000..121f6617b70
--- /dev/null
+++ b/databases/p5-Template-DBI/DESCR
@@ -0,0 +1,4 @@
+This Template Toolkit plugin module provides an interface to the Perl DBI/DBD
+modules, allowing to integrate SQL queries into template documents. It also
+provides an interface via the Tie::DBI module (if installed) so that database
+records can be accessed without having to embed any SQL in templates.
diff --git a/databases/p5-Template-DBI/Makefile b/databases/p5-Template-DBI/Makefile
new file mode 100644
index 00000000000..58416e31ac7
--- /dev/null
+++ b/databases/p5-Template-DBI/Makefile
@@ -0,0 +1,24 @@
+# $NetBSD: Makefile,v 1.1.1.1 2009/06/14 22:42:57 sno Exp $
+#
+
+DISTNAME= Template-DBI-2.64
+PKGNAME= p5-${DISTNAME}
+PKGREVISION= 1
+CATEGORIES= textproc
+MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=Template/}
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://search.cpan.org/dist/Template-DBI/
+COMMENT= Template interface to the DBI module
+LICENSE= gnu-gpl-v2 # OR artistic
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+DEPENDS+= p5-Template-Toolkit>=2.15:../../www/p5-Template-Toolkit
+DEPENDS+= p5-Tie-DBI-[0-9]*:../../databases/p5-Tie-DBI
+
+PERL5_PACKLIST= auto/Template/DBI/.packlist
+
+.include "../../databases/p5-DBI/buildlink3.mk"
+.include "../../lang/perl5/module.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/databases/p5-Template-DBI/distinfo b/databases/p5-Template-DBI/distinfo
new file mode 100644
index 00000000000..83165e38b66
--- /dev/null
+++ b/databases/p5-Template-DBI/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1.1.1 2009/06/14 22:42:57 sno Exp $
+
+SHA1 (Template-DBI-2.64.tar.gz) = 9f32974f4f9b53489d818c9c8546d65fd4921f18
+RMD160 (Template-DBI-2.64.tar.gz) = e7093c7498b245fc3ab2af04e567733c93012fb9
+Size (Template-DBI-2.64.tar.gz) = 13645 bytes
+SHA1 (patch-aa) = b6318935fb553efe2536b744f782d28dfff8f4b7
diff --git a/databases/p5-Template-DBI/patches/patch-aa b/databases/p5-Template-DBI/patches/patch-aa
new file mode 100644
index 00000000000..9017ac8b2fd
--- /dev/null
+++ b/databases/p5-Template-DBI/patches/patch-aa
@@ -0,0 +1,134 @@
+$NetBSD: patch-aa,v 1.1.1.1 2009/06/14 22:42:57 sno Exp $
+
+Skipping user interaction for running DBI tests
+
+--- Makefile.PL.orig 2009-06-03 20:23:48.000000000 +0000
++++ Makefile.PL 2009-06-03 20:32:01.000000000 +0000
+@@ -24,7 +24,7 @@
+ dbi_config();
+
+ my %opts = (
+- 'NAME' => 'Template-DBI',
++ 'NAME' => 'Template::DBI',
+ 'VERSION_FROM' => 'lib/Template/Plugin/DBI.pm',
+ 'PMLIBDIRS' => [ 'lib' ],
+ 'PREREQ_PM' => {
+@@ -59,63 +59,63 @@
+ sub dbi_config {
+ my ($dsn, $user, $pass) = ('') x 3;
+
+- if (ttprompt("Do you want to run the DBI tests?\n" .
+- "It requires access to an existing test database.",
+- $RUN_TESTS) =~ /y/i) {
+-
+- $RUN_TESTS = 1;
+- my ($driver, $dbname);
+- require DBI;
+- my @drivers = DBI->available_drivers();
+- local $" = ', ';
+-
+- my $default = (grep(/m.?sql/i, @drivers))[0]
+- || $drivers[0] || '';
+-
+- message(<<EOF);
+-
+-DBI Test Configuration
+-----------------------
+-
+-Please enter the driver name for the test database.
+-The DBD drivers installed on your system are
+-
+- @drivers
+-
+-EOF
+-
+- while (! $driver) {
+- $driver = ttprompt("Enter driver name: ", $default);
+- message("! No such DBD driver\n"), undef $driver
+- unless grep(/^$driver$/, @drivers);
+- }
+-
+- message(<<EOF);
+-
+-Now enter the data source (DSN) for the test database.
+-Many DBD drivers require only a database name (e.g. 'test') while
+-others may require an alternate format or additional parameters
+-(e.g. 'dbname=test'). Please consult your DBD documentation for
+-further details.
+-
+-EOF
+-
+- my $dbname_eg = $driver eq 'Pg' ? 'dbname=test' : 'test';
+- while (! $dbname) {
+- $dbname = ttprompt('Database name: ', $dbname_eg);
+- }
+-
+- $dsn = "dbi:$driver:$dbname";
+- $user = ttprompt('Enter user name : ', '');
+- $pass = ttprompt('Enter password : ', '');
+- $user = '' unless defined $user;
+- $pass = '' unless defined $pass;
+- }
+- else {
++# if (ttprompt("Do you want to run the DBI tests?\n" .
++# "It requires access to an existing test database.",
++# $RUN_TESTS) =~ /y/i) {
++#
++# $RUN_TESTS = 1;
++# my ($driver, $dbname);
++# require DBI;
++# my @drivers = DBI->available_drivers();
++# local $" = ', ';
++#
++# my $default = (grep(/m.?sql/i, @drivers))[0]
++# || $drivers[0] || '';
++#
++# message(<<EOF);
++#
++#DBI Test Configuration
++#----------------------
++#
++#Please enter the driver name for the test database.
++#The DBD drivers installed on your system are
++#
++# @drivers
++#
++#EOF
++#
++# while (! $driver) {
++# $driver = ttprompt("Enter driver name: ", $default);
++# message("! No such DBD driver\n"), undef $driver
++# unless grep(/^$driver$/, @drivers);
++# }
++#
++# message(<<EOF);
++#
++#Now enter the data source (DSN) for the test database.
++#Many DBD drivers require only a database name (e.g. 'test') while
++#others may require an alternate format or additional parameters
++#(e.g. 'dbname=test'). Please consult your DBD documentation for
++#further details.
++#
++#EOF
++#
++# my $dbname_eg = $driver eq 'Pg' ? 'dbname=test' : 'test';
++# while (! $dbname) {
++# $dbname = ttprompt('Database name: ', $dbname_eg);
++# }
++#
++# $dsn = "dbi:$driver:$dbname";
++# $user = ttprompt('Enter user name : ', '');
++# $pass = ttprompt('Enter password : ', '');
++# $user = '' unless defined $user;
++# $pass = '' unless defined $pass;
++# }
++# else {
+ $RUN_TESTS = 0;
+- }
++# }
+
+- message("\nwriting $CONFIG_PATH\n");
++# message("\nwriting $CONFIG_PATH\n");
+ open(CFGFILE, ">$CONFIG_PATH") || die "$CONFIG_PATH: $!\n";
+ print CFGFILE <<EOF;
+ \$run = $RUN_TESTS;