-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile.PL
247 lines (195 loc) · 6.84 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#!/usr/bin/perl -w
# Copyright 1998-2019, Paul Johnson (paul@pjcj.net)
# This software is free. It is licensed under the same terms as Perl itself.
# The latest version of this software should be available from my homepage:
# http://www.pjcj.net
use strict;
require 5.005;
use ExtUtils::MakeMaker;
use ExtUtils::Manifest "maniread";
our $WEBSERVICES_TESTING = 0;
if ($WEBSERVICES_TESTING) { # For automating webservices testing
eval '
use Apache::TestMM qw(test clean);
Apache::TestMM::filter_args();
Apache::TestMM::generate_script("t/TEST");
';
}
$| = 1;
my $Version = "1.22";
my $Date = "15th November 2019";
my $Author = 'paul@pjcj.net';
my @perlbug = ("perlbug", "-a", $Author,
"-s", "Installation of Gedcom $Version");
my $Perlbug = join " ", map { / / ? "'$_'" : $_ } @perlbug;
my @files = sort keys %{maniread()};
my @versions = grep { !/README|travis|Makefile\.PL/ } @files;
$ExtUtils::MakeMaker::Verbose = 0;
WriteMakefile(
NAME => "Gedcom",
VERSION => $Version,
AUTHOR => 'Paul Johnson (paul@pjcj.net)',
LICENSE => "perl_5",
ABSTRACT => "Interface to genealogy GEDCOM files",
DIR => [],
EXE_FILES => [ "cgi-bin/gedcom.cgi" ],
BUILD_REQUIRES => { "Pod::Markdown" => 0 },
TEST_REQUIRES => { "Test::Pod" => 0 },
PREREQ_PM => { "Text::Soundex" => 0 },
META_MERGE => {
license => [ "perl_5" ],
release_status => "stable",
# https://metacpan.org/pod/CPAN::Meta::Spec#PREREQUISITES
prereqs => {
build => {
requires => {
"Pod::Markdown" => 0,
},
},
test => {
recommends => {
"Test::Pod" => 0,
},
},
runtime => {
recommends => {
"Date::Manip" => 0,
"Parse::RecDescent" => 0,
"Roman" => 0,
},
},
},
resources => {
license => [ "http://dev.perl.org/licenses/" ],
bugtracker => {
web => "/~https://github.com/pjcj/Gedcom.pm/issues",
},
repository => {
type => "git",
url => "http://github.com/pjcj/Gedcom.pm",
web => "http://github.com/pjcj/Gedcom.pm",
},
x_mailing_list => "http://lists.perl.org/list/perl-gedcom.html",
},
"meta-spec" => {
version => 2,
url => "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
},
},
dist => { COMPRESS => "gzip --best --force" },
clean => { FILES => join " ", map { "$_.version" } @versions },
depend => { distdir => "@files" },
);
print "\n";
print "checking for Date::Manip .......... ";
eval "use Date::Manip";
if (my $m = $INC{"Date/Manip.pm"}) {
print "$m\n";
} else {
print <<EOM;
not found
Date::Manip.pm is required to use the Gedcom function normalise_dates(). This
function will be unavailable until you install this module, available from CPAN.
In the meantime, you may continue to use the rest of Gedcom.pm.
EOM
}
print "checking for Parse::RecDescent .... ";
eval "use Parse::RecDescent";
if (my $m = $INC{"Parse/RecDescent.pm"}) {
print "$m\n";
} else {
print <<EOM;
not found
Parse::RecDescent.pm is required to use the Gedcom program lines2perl. This
program will be unavailable until you install this module, available from CPAN.
In the meantime, you may continue to use the rest of Gedcom.pm.
EOM
}
print "checking for Roman ................ ";
eval "use Roman";
if (my $m = $INC{"Roman.pm"}) {
print "$m\n";
} else {
print <<EOM;
not found
Roman.pm is required to use the Gedcom function roman(). This function may be
called from lines2perl if your LifeLines program calls roman(). This function
will be unavailable until you install this module, available from CPAN. In the
meantime, you may continue to use the rest of Gedcom.pm.
EOM
}
print "checking for working IO::Handle ... ";
eval <<'EOE';
use FileHandle;
my $fh = FileHandle->new("Makefile.PL");
$fh->getline;
$fh->input_line_number;
EOE
if ($@) {
print <<'EOM';
broken
You have a broken IO::Handle module. In particular, the input_line_number
method causes an error. Gedcom.pm will work around the problem, but if you
experience other problems with this function, or your use of $., you may wish to
solve the problem.
Perl 5.005_03 and (I believe) some developer releases have this problem, as does
IO.pm version 1.20. The problem is fixed as from 5.005_57. If you would like
to patch your Perl, my patch is available at
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-04/msg02366.html
or send me mail.
EOM
} else {
print "working\n";
}
print <<EOM;
--------------------------------------------------------------------------------
If you have any questions or comments please send a message to the perl-gedcom
mailing list, details of which are available in the README file.
If you can run perlbug you can send me a success report with "make ok".
Failure reports with "make nok" are also appreciated.
EOM
sub MY::postamble {
qq[
tags : @files
\t ptags @files
grammar : pure_all gedcom-5.5.grammar gedcom-5.5.1.grammar
\t \$(PERL) -Mblib parse_grammar gedcom-5.5.grammar
\t \$(PERL) -Mblib parse_grammar gedcom-5.5.1.grammar
\t \$(PERL) utils/makeh set_version $Version "$Date" lib/Gedcom/Grammar_5_5*.pm
\t \$(PERL) -pi -e 's/^ +//' lib/Gedcom/Grammar_5_5*.pm
@versions : Makefile.PL
\t \$(PERL) utils/makeh set_version $Version "$Date" @versions
\t \$(MAKE) grammar README.md
README.md : lib/Gedcom.pm utils/makeh
\t pod2markdown < lib/Gedcom.pm | \$(PERL) utils/makeh munge_readme > README.md
t : pure_all
\t exec make test HARNESS_OPTIONS=j8:c HARNESS_TIMER=1
# Webservies section
restart : all
\t t/TEST -stop && rm -f t/logs/*log && t/TEST -start \$(TEST_OPTIONS)
restart_cover : all
\t t/TEST -stop && cover && rm -f t/logs/*log && \\
t/TEST -defines COVER -one-process -start \$(TEST_OPTIONS)
stop : all
\t t/TEST -stop
runtestcover : all
\t rm -f t/logs/*log && \\
DEVEL_COVER=1 t/TEST -defines COVER -one-process -verbose \$(TEST_OPTIONS) && \\
cover -report html_basic
mytestcover : all
\t cover -delete && \\
rm -f t/logs/*log && \\
DEVEL_COVER=1 t/TEST -defines COVER -one-process \$(TEST_OPTIONS) && \\
cover -report html_basic
# cover : mytestcover
cgi : all install
\t cp `dirname \$(PERL)`/gedcom.cgi cgi-bin && \\
rm *.ged && \\
ln -s ../ged/* .
# Reports
ok :
\t \@$Perlbug -okay || echo "Please send your report manually to $Author"
nok :
\t \@$Perlbug -nokay || echo "Please send your report manually to $Author"
]
}