1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
#
# Copyright (C) 1998, 1999 Loic Dachary
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
# $Header: /cvsroot/TextQuery/Text-Query-SQL/Makefile.PL,v 1.3 2000/04/12 16:35:28 loic Exp $
#
# This -*- perl -*- script writes the Makefile for Catalog
require 5.004;
use strict;
#--- Configuration section ---
use ExtUtils::MakeMaker;
version_check('Text::Query', '0.07', 'require Text::Query;');
version_check('DBI', '1.06', 'require DBI;');
version_check('Data::Dumper', '2.09', 'require Data::Dumper;');
#
# Check that package $what is installed and that
# it's version is at least $min_version.
# Use $test to check that package exists : usually something like
# $test = 'require MIME::Base64;';
# Dies if package not present or wrong version.
#
sub version_check {
my($what, $min_version, $test) = @_;
print "Checking for $what... ";
$test .= "; die '' if(\$${what}::VERSION < \$min_version); \$${what}::VERSION";
my $got_version = eval $test;
$got_version = "undef" unless defined $got_version;
if ($@) {
print " failed\n";
print <<EOT;
$@
Catalog needs $what module, version >= $min_version
EOT
exit;
} else {
eval "print \" \$${what}::VERSION ok\n\"";
}
}
WriteMakefile(
'VERSION_FROM' => 'lib/Text/Query/BuildSQL.pm',
'NAME' => 'Text::Query::SQL',
);
|