Mercurial > hg > monetdb-perl
changeset 1:f899cb48b4cc
Turned into independent repository.
Updated version numbers to 1.00; added Fedora spec file; added
top-level Makefile.
author | Sjoerd Mullender <sjoerd@acm.org> |
---|---|
date | Mon, 19 Sep 2016 15:20:16 +0200 (2016-09-19) |
parents | cedccb7e0143 |
children | cb53f63794d6 |
files | DBD/Changes DBD/Makefile.PL DBD/Makefile.ag DBD/README DBD/monetdb.pm DBD/monetdb/Makefile.ag Makefile Makefile.ag Mapi.pm MonetDB-CLI-MapiPP/Makefile.ag MonetDB-CLI-MapiPP/MonetDB/CLI/Changes MonetDB-CLI-MapiPP/MonetDB/CLI/MANIFEST MonetDB-CLI-MapiPP/MonetDB/CLI/Makefile.PL MonetDB-CLI-MapiPP/MonetDB/CLI/Makefile.ag MonetDB-CLI-MapiPP/MonetDB/CLI/Mapi.pm MonetDB-CLI-MapiPP/MonetDB/CLI/MapiPP.pm MonetDB-CLI-MapiPP/MonetDB/CLI/README MonetDB-CLI-MapiPP/MonetDB/Makefile.ag MonetDB-CLI/Makefile.ag MonetDB-CLI/MonetDB/CLI.pm MonetDB-CLI/MonetDB/Changes MonetDB-CLI/MonetDB/Makefile.PL MonetDB-CLI/MonetDB/Makefile.ag MonetDB-CLI/MonetDB/README license.txt mclient.pl perl-DBD-monetdb.spec |
diffstat | 26 files changed, 571 insertions(+), 576 deletions(-) [+] |
line wrap: on
line diff
new file mode 100644 --- /dev/null +++ b/DBD/Changes @@ -0,0 +1,3 @@ +Please visit the Mercurial repository: + + http://dev.monetdb.org/hg/monetdb-perl/
--- a/DBD/Makefile.PL +++ b/DBD/Makefile.PL @@ -5,5 +5,5 @@ WriteMakefile NAME => 'DBD::monetdb' , VERSION_FROM => 'monetdb.pm' , ABSTRACT_FROM => 'monetdb.pm' -, PREREQ_PM => { DBI => 1.45, 'MonetDB::CLI' => 0.01 } +, PREREQ_PM => { DBI => 1.45, 'MonetDB::CLI' => 1.00 } );
deleted file mode 100644 --- a/DBD/Makefile.ag +++ /dev/null @@ -1,15 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - -MTSAFE - -SUBDIRS = monetdb - -headers_perl = { - HEADERS = pl pm - DIR = $(prefix)/$(PERL_LIBDIR)/DBD - SOURCES = monetdb.pm -}
--- a/DBD/README +++ b/DBD/README @@ -90,8 +90,3 @@ AUTHORS COPYRIGHT AND LICENCE - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - - Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.
--- a/DBD/monetdb.pm +++ b/DBD/monetdb.pm @@ -5,7 +5,7 @@ use DBI(); use Encode(); use MonetDB::CLI(); -our $VERSION = '0.10'; +our $VERSION = '1.00'; our $drh = undef; require DBD::monetdb::GetInfo; @@ -293,7 +293,7 @@ SQL $sql .= " order by table_type, table_schem, table_name\n"; my $sth = $dbh->prepare($sql) or return; $sth->execute(@bv) or return; - + $dbh->set_err(0,"Catalog parameter c has to be an empty string, as MonetDB does not support multiple catalogs") if $c ne ""; return $sth; } @@ -301,7 +301,7 @@ SQL sub table_info { my($dbh, $c, $s, $t, $tt) = @_; - + if ( defined $c && defined $s && defined $t ) { if ( $c eq '%' && $s eq '' && $t eq '') { return monetdb_catalog_info($dbh);
deleted file mode 100644 --- a/DBD/monetdb/Makefile.ag +++ /dev/null @@ -1,13 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - -MTSAFE - -headers_perl = { - HEADERS = pm - DIR = $(prefix)/$(PERL_LIBDIR)/DBD/monetdb - SOURCES = GetInfo.pm TypeInfo.pm -}
new file mode 100644 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +# configuration for "perl Makefile.PL" +# use e.g. "make CONFIG=PREFIX=$HOME" +CONFIG = + +all: MonetDB-CLI-MapiPP/MonetDB/CLI/Makefile MonetDB-CLI/MonetDB/Makefile DBD/Makefile + cd MonetDB-CLI-MapiPP/MonetDB/CLI; $(MAKE) + cd MonetDB-CLI/MonetDB; $(MAKE) + cd DBD; $(MAKE) + +install: all + cd MonetDB-CLI-MapiPP/MonetDB/CLI; $(MAKE) install DESTDIR=$(DESTDIR) + cd MonetDB-CLI/MonetDB; $(MAKE) install DESTDIR=$(DESTDIR) + cd DBD; $(MAKE) install DESTDIR=$(DESTDIR) + +pure_install: all + cd MonetDB-CLI-MapiPP/MonetDB/CLI; $(MAKE) pure_install DESTDIR=$(DESTDIR) + cd MonetDB-CLI/MonetDB; $(MAKE) pure_install DESTDIR=$(DESTDIR) + cd DBD; $(MAKE) pure_install DESTDIR=$(DESTDIR) + +clean: + cd MonetDB-CLI-MapiPP/MonetDB/CLI; rm -rf blib MYMETA.* pm_to_blib Makefile + cd MonetDB-CLI/MonetDB; rm -rf blib MYMETA.* pm_to_blib Makefile + cd DBD; rm -rf blib MYMETA.* pm_to_blib Makefile + + +MonetDB-CLI-MapiPP/MonetDB/CLI/Makefile: MonetDB-CLI-MapiPP/MonetDB/CLI/Makefile.PL + cd MonetDB-CLI-MapiPP/MonetDB/CLI; perl Makefile.PL $(CONFIG) + +MonetDB-CLI/MonetDB/Makefile: MonetDB-CLI/MonetDB/Makefile.PL + cd MonetDB-CLI/MonetDB; perl Makefile.PL $(CONFIG) + +DBD/Makefile: DBD/Makefile.PL + cd DBD; perl Makefile.PL $(CONFIG)
deleted file mode 100644 --- a/Makefile.ag +++ /dev/null @@ -1,15 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - -MTSAFE - -SUBDIRS = MonetDB-CLI-MapiPP MonetDB-CLI DBD Tests - -headers_perl = { - HEADERS = pm - DIR = $(prefix)/$(PERL_LIBDIR) - SOURCES = Mapi.pm -}
deleted file mode 100644 --- a/MonetDB-CLI-MapiPP/Makefile.ag +++ /dev/null @@ -1,7 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - -SUBDIRS = MonetDB
new file mode 100644 --- /dev/null +++ b/MonetDB-CLI-MapiPP/MonetDB/CLI/Changes @@ -0,0 +1,3 @@ +Please visit the Mercurial repository: + + http://dev.monetdb.org/hg/monetdb-perl/
--- a/MonetDB-CLI-MapiPP/MonetDB/CLI/MANIFEST +++ b/MonetDB-CLI-MapiPP/MonetDB/CLI/MANIFEST @@ -3,6 +3,7 @@ MANIFEST MANIFEST.SKIP Makefile.PL README +Mapi.pm MapiPP.pm t/00use.t t/02cxn.t
--- a/MonetDB-CLI-MapiPP/MonetDB/CLI/Makefile.PL +++ b/MonetDB-CLI-MapiPP/MonetDB/CLI/Makefile.PL @@ -5,5 +5,5 @@ WriteMakefile NAME => 'MonetDB::CLI::MapiPP' , VERSION_FROM => 'MapiPP.pm' , ABSTRACT_FROM => 'MapiPP.pm' -, PREREQ_PM => { 'IO::Socket::INET' => 0 } +, PREREQ_PM => { 'IO::Socket::INET' => 0 } );
deleted file mode 100644 --- a/MonetDB-CLI-MapiPP/MonetDB/CLI/Makefile.ag +++ /dev/null @@ -1,13 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - -MTSAFE - -headers_perl = { - HEADERS = pm - DIR = $(prefix)/$(PERL_LIBDIR)/MonetDB/CLI - SOURCES = MapiPP.pm -}
rename from Mapi.pm rename to MonetDB-CLI-MapiPP/MonetDB/CLI/Mapi.pm --- a/Mapi.pm +++ b/MonetDB-CLI-MapiPP/MonetDB/CLI/Mapi.pm @@ -4,7 +4,7 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. -package Mapi; +package MonetDB::CLI::Mapi; use strict; use Socket; @@ -12,6 +12,8 @@ use IO::Socket; use Digest::MD5 'md5_hex'; use Digest::SHA qw(sha1_hex sha256_hex sha512_hex); +our $VERSION = '1.00'; + sub pass_chal { my ($passwd, @challenge) = @_; if ($challenge[2] == 9) { @@ -97,7 +99,7 @@ sub new { my $passchal = pass_chal($passwd, @challenge) || die; - # content_byteorder(BIG/LIT):user:{cypher_algo}mypasswordchallenge_cyphered:lang:database: + # content_byteorder(BIG/LIT):user:{cypher_algo}mypasswordchallenge_cyphered:lang:database: $self->putblock("LIT:$user:$passchal:$lang:$db:\n"); my $prompt = $self->getblock(); if ($prompt =~ /^\^mapi:monetdb:/) { @@ -105,7 +107,7 @@ sub new { $self->{socket}->close; print "Following redirect: $prompt\n" if ($self->{trace}); my @tokens = split(/[\n\/:\?]+/, $prompt); # dirty, but it's Perl anyway - return new Mapi($tokens[3], $tokens[4], $user, $passwd, $lang, $tokens[5], $trace); + return new MonetDB::CLI::Mapi($tokens[3], $tokens[4], $user, $passwd, $lang, $tokens[5], $trace); } elsif ($prompt =~ /^\^mapi:merovingian:\/\/proxy/) { # proxied redirect do { @@ -125,7 +127,7 @@ sub new { # How to create a duplicate sub clone { my ($self,$src)= @_; - bless($self,"Mapi"); + bless($self,"MonetDB::CLI::Mapi"); print "cloning\n" if ($self->{trace}); $self->{host} = $src->{host}; $self->{port} = $src->{port}; @@ -177,7 +179,7 @@ sub resetState { print "resetState\n" if ($self->{trace}); $self->{errstr}=""; $self->{error}=0; - $self->{active}=0; + $self->{active}=0; } #packge the request and ship it, the back-end reads blocks! @@ -228,7 +230,7 @@ sub getRow { my $row = $self->{lines}[$self->{next}++]; my @chars = split(//, $row,3); - if ($chars[0] eq '!') { + if ($chars[0] eq '!') { $self->error($row); my $i = 1; while ($self->{lines}[$i] =~ '!') { @@ -251,7 +253,7 @@ sub getRow { $self->{active} = 1; } elsif ($chars[0] eq '=') { # xml result line - $self->{row} = substr($row, 1); # skip = + $self->{row} = substr($row, 1); # skip = $self->{active} = 1; } elsif ($chars[0] eq '^') { # ^ redirect, ie use different server @@ -321,16 +323,16 @@ sub getBlock { $self->{row} = "" . $cnt; $self->{next} = $cnt; # all done return -2; - } elsif ($chars[1] eq '3') { # transaction + } elsif ($chars[1] eq '3') { # transaction # nothing todo - } elsif ($chars[1] eq '4') { # auto_commit + } elsif ($chars[1] eq '4') { # auto_commit my ($dummy,$ac) = split(' ', $header); if ($ac eq 't') { $self->{auto_commit} = 1; } else { $self->{auto_commit} = 0; } - } elsif ($chars[1] eq '5') { # prepare + } elsif ($chars[1] eq '5') { # prepare my ($dummy,$id,$cnt,$nrcols,$replysize) = split(' ', $header); # TODO parse result, rows (type, digits, scale) $self->{count} = $cnt; @@ -341,7 +343,7 @@ sub getBlock { } } else { return $self->getRow(); - } + } return $self->{active}; } @@ -365,7 +367,7 @@ sub getReply { $self->{skip_in}++; } $self->{active} = 0; - } + } return $self->{active}; }
--- a/MonetDB-CLI-MapiPP/MonetDB/CLI/MapiPP.pm +++ b/MonetDB-CLI-MapiPP/MonetDB/CLI/MapiPP.pm @@ -2,11 +2,11 @@ package MonetDB::CLI::MapiPP; use Text::ParseWords(); use Encode (); -use Mapi; +use MonetDB::CLI::Mapi; use strict; use warnings; -our $VERSION = '0.04'; +our $VERSION = '1.00'; my %unescape = ( n => "\n", t => "\t", r => "\r", f => "\f"); @@ -26,7 +26,7 @@ sub connect { my ($class, $host, $port, $user, $pass, $lang, $db) = @_; - my $h = new Mapi($host, $port, $user, $pass, $lang, $db, 0) + my $h = new MonetDB::CLI::Mapi($host, $port, $user, $pass, $lang, $db, 0) or die "Making connection failed: $@"; bless { h => $h },'MonetDB::CLI::MapiPP::Cxn'; @@ -181,7 +181,7 @@ sub fetch my ($self) = @_; return if ++$self->{i} >= $self->{affrows}; - + if ($self->{id}) { utf8::decode($self->{h}->{row}); my @cols = split(/,\t */, $self->{h}->{row}); @@ -196,7 +196,7 @@ sub fetch } else { $self->{currow} = $self->{rows}[$self->{i}]; } - + return @{$self->{currow}}; }
--- a/MonetDB-CLI-MapiPP/MonetDB/CLI/README +++ b/MonetDB-CLI-MapiPP/MonetDB/CLI/README @@ -63,8 +63,3 @@ AUTHORS COPYRIGHT AND LICENCE - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - - Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.
deleted file mode 100644 --- a/MonetDB-CLI-MapiPP/MonetDB/Makefile.ag +++ /dev/null @@ -1,7 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - -SUBDIRS = CLI
deleted file mode 100644 --- a/MonetDB-CLI/Makefile.ag +++ /dev/null @@ -1,7 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - -SUBDIRS = MonetDB
--- a/MonetDB-CLI/MonetDB/CLI.pm +++ b/MonetDB-CLI/MonetDB/CLI.pm @@ -1,6 +1,6 @@ package MonetDB::CLI; -our $VERSION = '0.03'; +our $VERSION = '1.00'; our @Modules = split /;/, $ENV{PERL_MONETDB_CLI_MODULES} || 'MonetDB::CLI::MapiPP';
new file mode 100644 --- /dev/null +++ b/MonetDB-CLI/MonetDB/Changes @@ -0,0 +1,3 @@ +Please visit the Mercurial repository: + + http://dev.monetdb.org/hg/monetdb-perl/
--- a/MonetDB-CLI/MonetDB/Makefile.PL +++ b/MonetDB-CLI/MonetDB/Makefile.PL @@ -5,5 +5,5 @@ WriteMakefile NAME => 'MonetDB::CLI' , VERSION_FROM => 'CLI.pm' , ABSTRACT_FROM => 'CLI.pm' -, PREREQ_PM => { 'MonetDB::CLI::MapiPP' => 0.01 } +, PREREQ_PM => { 'MonetDB::CLI::MapiPP' => 1.00 } );
deleted file mode 100644 --- a/MonetDB-CLI/MonetDB/Makefile.ag +++ /dev/null @@ -1,13 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. - -MTSAFE - -headers_perl = { - HEADERS = pm - DIR = $(prefix)/$(PERL_LIBDIR)/MonetDB - SOURCES = CLI.pm -}
--- a/MonetDB-CLI/MonetDB/README +++ b/MonetDB-CLI/MonetDB/README @@ -68,8 +68,3 @@ AUTHORS COPYRIGHT AND LICENCE - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - - Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.
--- a/mclient.pl +++ b/mclient.pl @@ -6,13 +6,13 @@ # # Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V. -use Mapi; +use MonetDB::CLI::Mapi; my $db = shift || ''; my $port = shift || 50000; my ($monet, $line); -$monet = new Mapi('localhost', $port, 'monetdb', 'monetdb', 'sql', $db, 0); +$monet = new MonetDB::CLI::Mapi('localhost', $port, 'monetdb', 'monetdb', 'sql', $db, 0); print "> "; while ( !(($line=<>) =~ /\q/) ){
new file mode 100644 --- /dev/null +++ b/perl-DBD-monetdb.spec @@ -0,0 +1,55 @@ +Name: perl-DBD-monetdb +Version: 1.0 +Release: 1%{?dist} +Summary: MonetDB perl interface + +License: MPLv2.0 +URL: http://www.monetdb.org/ +Source0: https://dev.monetdb.org/hg/monetdb-perl/archive/v%{version}.tar.bz2 + +BuildArch: noarch +BuildRequires: perl +BuildRequires: perl-generators +# Correct for lots of packages, other common choices include eg. Module::Build +BuildRequires: perl(ExtUtils::MakeMaker) +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) + +Obsoletes: MonetDB-client-perl +Recommends: MonetDB-SQL-server5 + +%{?perl_default_filter} + +%description +MonetDB is a database management system that is developed from a +main-memory perspective with use of a fully decomposed storage model, +automatic index management, extensibility of data types and search +accelerators. It also has an SQL frontend. + +This package contains the files needed to use MonetDB from a Perl +program. + +%prep +%autosetup -n monetdb-perl-v%{version} + + +%build +%make_build CONFIG=INSTALLDIRS=vendor + +%install +rm -rf $RPM_BUILD_ROOT +make pure_install DESTDIR=$RPM_BUILD_ROOT +find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';' +find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null ';' +%{_fixperms} $RPM_BUILD_ROOT/* + + +%files +%license license.txt +#%doc add-docs-here +%{perl_vendorlib}/* +%{_mandir}/man3/*.3* + + +%changelog +* Mon Sep 19 2016 Sjoerd Mullender <sjoerd@mullender.nl> +- The Perl interface to MonetDB is now a separate package.