-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.PL
175 lines (131 loc) · 3.56 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# $Id$
use strict;
use Text::Wrap;
use File::Spec;
use lib './t/lib';
use ExtUtils::MakeMaker;
# ------------------------------------------------
sub create_changelog_ini
{
my($error);
eval "require Module::Metadata::Changes";
if ($@)
{
$error = $@;
}
else
{
# Ensure Changelog.ini is writable.
if (-e 'Changelog.ini' && ! -w 'Changelog.ini')
{
$error = (chmod 0200, 'Changelog.ini' == 0) ? 'Could not make Changelog.ini writable' : '';
}
if (! $error)
{
eval
{
print "Regenerating Changelog.ini...\n";
`ini.report.pl -c -i Changes`;
if (! -e 'Changelog.ini')
{
# Warning: Can't use $@ to carry msg out of block(s).
$error = 'Failed to generate Changelog.ini';
}
else
{
my(@stat) = stat 'Changelog.ini';
# Was the file modified in the last 2 seconds?
if ( (time() - $stat[9]) < 2)
{
# Yes. Do nothing.
}
else
{
$error = 'Failed to update Changelog.ini';
}
}
};
if ($@)
{
$error = $@;
}
}
}
# We ignore the precise value of $@ here.
if ($error)
{
print "Warning: Module::Metadata::Changes's ini.report.pl failed to generate or update Changelog.ini. \n";
}
else
{
print "Changelog.ini generated or updated. \n";
}
} # End of create_changelog_ini.
# ------------------------------------------------
print "-" x 40, "\n";
print fill("", "", <<'MESSAGE');
#### WARNING ####
If you are using custom CGI::Session drivers they may not be compatible with the current driver specifications. You will need to make some changes to your drivers' code before proceeding with this installation to make it compatible with CGI::Session 4.x.
Fortunately, current driver specifications are a lot easier to adapt to. Should you have any assistance re-coding your current drivers, please let me know.
Current driver specs are documented in CGI/Session/Driver.pm
#### TESTING #####
You are encouraged to run tests for the backend you will be using. The database backends that need a customized connection string won't run by default. To run them, some environment variables must be set.
The simplest method is to use the standard "DBI_DSN/DBI_USER/DBI_PASS" environment variables.
Otherwise, you can set these variables:
MESSAGE
print "
For PostgreSQL:
CGISESS_PG_DSN
CGISESS_PG_USER
CGISESS_PG_PASS
For MySQL:
CGISESS_MYSQL_DSN
CGISESS_MYSQL_USER
CGISESS_MYSQL_PASS
CGISESS_MYSQL_SOCKET
";
print "\n";
print "-" x 40, "\n";
create_changelog_ini();
print "-" x 40, "\n";
WriteMakefile(
NAME => 'CGI::Session',
VERSION_FROM => 'lib/CGI/Session.pm',
PL_FILES => {},
PREREQ_PM => {
'CGI' => 3.26,
'Digest::MD5' => 0,
'Data::Dumper' => 0,
# 'Test::Differences' => 0,
'Test::More' => 0,
'Scalar::Util' => 0,
},
ABSTRACT => 'Persistent session data in CGI applications',
AUTHOR => 'Sherzod Ruzmetov <[email protected]>',
clean => { FILES => [ 't/cgisess.*', 't/sessiondata' ] },
EXTRA_META => "
no_index:
package:
- CGI::Session::Test::SimpleObjectClass
- CGI::Session::Test::Default
- OverloadedObjectClass
- OverloadedClass
",
);
#
# Creating place for test-scripts. Some of the scripts needs this to be present
#
mkdir(File::Spec->catfile('t', 'sessiondata'));
package MY;
use strict;
sub postamble {
return <<'MAKE_TEXT';
prepare_dist :: metafile manifest dist
$(NOECHO) $(NOOP)
MAKE_TEXT
}
sub libscan {
my ($self, $path) = @_;
return '' if $path =~ m/\.svn/;
return $path;
}