-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.PL
72 lines (58 loc) · 2.13 KB
/
Makefile.PL
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
64
65
66
67
68
69
70
71
72
use 5.008000;
use ExtUtils::MakeMaker;
use Getopt::Long();
use Data::Dumper;
use vars qw($opt);
$opt = {};
Getopt::Long::GetOptions(
$opt,
"help" => sub {Usage()},
"dsn=s",
"user=s",
"password:s",
"table=s",
) || die Usage();
my ($dsn, $user, $password, $table) = ('', '', 'UNDEF', '');
$dsn = $ENV{DBI_DSN} if (exists($ENV{DBI_DSN}));
$user = $ENV{DBI_USER} if (exists($ENV{DBI_USER}));
$password = $ENV{DBI_PASS} if (exists($ENV{DBI_PASS}));
$table = $ENV{DBI_TABLE} if (exists($ENV{DBI_TABLE}));
$dsn = $opt->{dsn} if (exists($opt->{dsn}));
$user = $opt->{user} if (exists($opt->{user}));
$password = $opt->{password} if (exists($opt->{password}));
$table = $opt->{table} if (exists($opt->{table}));
$table ||= 'drop_me_dbixl4p';
open OUT, ">dbixl4p.config";
print OUT "$dsn\n";
print OUT "$user\n";
print OUT "$password\n";
print OUT "$table\n";
close OUT;
warn "\nPlease NOTE\nYou need to set and export the DBI_* environment variables or supply suitable\nvalues on the command line (see Perl Makefile.PL --help) to run a complete test\n\n";
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
NAME => 'DBIx::Log4perl',
VERSION_FROM => 'lib/DBIx/Log4perl.pm', # finds $VERSION
PREREQ_PM => {Log::Log4perl => 1.04,
DBI => 1.50,
Test::More => 0.62},
($] >= 5.005 ? ## Add these new keywords supported since 5.005
(ABSTRACT_FROM => 'lib/DBIx/Log4perl.pm', # retrieve abstract from module
AUTHOR => 'Martin J. Evans <[email protected]>') : ()),
NO_META => 1
);
sub Usage {
print STDERR <<"USAGE";
Usage: perl $0 [options]
Possible options are:
--dsn=<db> The DBI DSN to pass to DBI->connect
--user=<user> Use the username <user> for running the test suite;
defaults to no username
--password=<pwd> Use the password <pwd> for running the test suite;
defaults to no password
--table=<table> A table to be used as a test table in the DB
defaults to dbixl4p
USAGE
exit 1;
}