Skip to content
Newer
Older
100644 262 lines (200 sloc) 6.55 KB
c46efff @pjcj Add some ws_plain write tests.
authored
1 #!/usr/bin/perl -w
36c030d @pjcj Version 1.01
authored
2
db0cd5d @pjcj Update copyright.
authored
3 # Copyright 1998-2005, Paul Johnson (pjcj@cpan.org)
36c030d @pjcj Version 1.01
authored
4
5 # This software is free. It is licensed under the same terms as Perl itself.
6
7 # The latest version of this software should be available from my homepage:
af7dbd3 @pjcj Version 1.09
authored
8 # http://www.pjcj.net
36c030d @pjcj Version 1.01
authored
9
10 use strict;
11
80d9237 @pjcj Version 1.05
authored
12 require 5.005;
0190b44 @pjcj Version 0.01
authored
13
14 use ExtUtils::MakeMaker;
c418b73 @pjcj Version 1.13
authored
15 use ExtUtils::Manifest "maniread";
0190b44 @pjcj Version 0.01
authored
16
a0eace9 @pjcj Skip ws_plain.t when mod_pelr is not available.
authored
17 eval
18 q{
6627328 @pjcj Move modules into lib directory.
authored
19 use Apache::TestMM qw(test clean);
20 Apache::TestMM::filter_args();
21 Apache::TestMM::generate_script("t/TEST");
a0eace9 @pjcj Skip ws_plain.t when mod_pelr is not available.
authored
22 };
6627328 @pjcj Move modules into lib directory.
authored
23
a036b0b @pjcj Version 1.04
authored
24 $| = 1;
25
2a1dc57 @pjcj Document WebServices.
authored
26 my $Version = "1.1502";
27 my $Date = "20th December 2005";
6627328 @pjcj Move modules into lib directory.
authored
28 my $Author = 'pjcj@cpan.org';
af7dbd3 @pjcj Version 1.09
authored
29
6627328 @pjcj Move modules into lib directory.
authored
30 my @perlbug = ("perlbug", "-a", $Author,
31 "-s", "Installation of Gedcom $Version");
af7dbd3 @pjcj Version 1.09
authored
32
6627328 @pjcj Move modules into lib directory.
authored
33 my $Perlbug = join " ", map { / / ? "'$_'" : $_ } @perlbug;
af7dbd3 @pjcj Version 1.09
authored
34
c418b73 @pjcj Version 1.13
authored
35 my @files = sort keys %{maniread()};
2829f22 @pjcj Version 1.02
authored
36 my @versions = grep { $_ ne "README" && $_ ne "Makefile.PL" } @files;
36c030d @pjcj Version 1.01
authored
37
af7dbd3 @pjcj Version 1.09
authored
38 $ExtUtils::MakeMaker::Verbose = 0;
39
0190b44 @pjcj Version 0.01
authored
40 WriteMakefile
41 (
2a1dc57 @pjcj Document WebServices.
authored
42 NAME => "Gedcom",
43 VERSION => $Version,
44 AUTHOR => 'Paul Johnson (pjcj@cpan.org)',
45 ABSTRACT => "Interface to genealogy GEDCOM files",
46 DIR => [],
47 EXE_FILES => [ "cgi-bin/gedcom.cgi" ],
48 dist => { COMPRESS => "gzip --best --force" },
49 clean => { FILES => join " ", map { "$_.version" } @versions },
50 depend => { distdir => "@files" },
0190b44 @pjcj Version 0.01
authored
51 );
52
a036b0b @pjcj Version 1.04
authored
53 print "\n";
c48001c @pjcj Version 1.06
authored
54 print "checking for Date::Manip.pm........ ";
a036b0b @pjcj Version 1.04
authored
55
36c030d @pjcj Version 1.01
authored
56 eval "use Date::Manip";
a036b0b @pjcj Version 1.04
authored
57 if (my $m = $INC{"Date/Manip.pm"})
58 {
6627328 @pjcj Move modules into lib directory.
authored
59 print "$m\n";
a036b0b @pjcj Version 1.04
authored
60 }
61 else
36c030d @pjcj Version 1.01
authored
62 {
6627328 @pjcj Move modules into lib directory.
authored
63 print <<EOM;
a036b0b @pjcj Version 1.04
authored
64 not found
65
c48001c @pjcj Version 1.06
authored
66 Date::Manip.pm is required to use the Gedcom function normalise_dates(). This
a036b0b @pjcj Version 1.04
authored
67 function will be unavailable until you install this module, available from CPAN.
68 In the meantime, you may continue to use the rest of Gedcom.pm.
36c030d @pjcj Version 1.01
authored
69
70 EOM
71 }
72
c48001c @pjcj Version 1.06
authored
73 print "checking for Text::Soundex.pm...... ";
80d9237 @pjcj Version 1.05
authored
74
75 eval "use Text::Soundex";
76 if (my $m = $INC{"Text/Soundex.pm"})
77 {
6627328 @pjcj Move modules into lib directory.
authored
78 print "$m\n";
80d9237 @pjcj Version 1.05
authored
79 }
80 else
81 {
6627328 @pjcj Move modules into lib directory.
authored
82 print <<EOM;
80d9237 @pjcj Version 1.05
authored
83 not found
84
c48001c @pjcj Version 1.06
authored
85 Text::Soundex.pm is required to use the Gedcom function soundex(). This
86 function will be unavailable until you install this module, available from CPAN.
87 In the meantime, you may continue to use the rest of Gedcom.pm.
80d9237 @pjcj Version 1.05
authored
88
89 EOM
90 }
91
c48001c @pjcj Version 1.06
authored
92 print "checking for Parse::RecDescent.pm.. ";
a036b0b @pjcj Version 1.04
authored
93
94 eval "use Parse::RecDescent";
95 if (my $m = $INC{"Parse/RecDescent.pm"})
96 {
6627328 @pjcj Move modules into lib directory.
authored
97 print "$m\n";
a036b0b @pjcj Version 1.04
authored
98 }
99 else
100 {
6627328 @pjcj Move modules into lib directory.
authored
101 print <<EOM;
a036b0b @pjcj Version 1.04
authored
102 not found
103
c48001c @pjcj Version 1.06
authored
104 Parse::RecDescent.pm is required to use the Gedcom program lines2perl. This
a036b0b @pjcj Version 1.04
authored
105 program will be unavailable until you install this module, available from CPAN.
106 In the meantime, you may continue to use the rest of Gedcom.pm.
107
108 EOM
109 }
110
c48001c @pjcj Version 1.06
authored
111 print "checking for Roman.pm.............. ";
112
113 eval "use Roman";
114 if (my $m = $INC{"Roman.pm"})
115 {
6627328 @pjcj Move modules into lib directory.
authored
116 print "$m\n";
c48001c @pjcj Version 1.06
authored
117 }
118 else
119 {
6627328 @pjcj Move modules into lib directory.
authored
120 print <<EOM;
c48001c @pjcj Version 1.06
authored
121 not found
122
123 Roman.pm is required to use the Gedcom function roman(). This function may be
124 called from lines2perl if your LifeLines program calls roman(). This function
125 will be unavailable until you install this module, available from CPAN. In the
126 meantime, you may continue to use the rest of Gedcom.pm.
127
128 EOM
129 }
130
131 print "checking for working IO::Handle.... ";
a036b0b @pjcj Version 1.04
authored
132
133 eval <<'EOE';
6627328 @pjcj Move modules into lib directory.
authored
134 use FileHandle;
135 my $fh = FileHandle->new("Makefile.PL");
136 $fh->getline;
137 $fh->input_line_number;
a036b0b @pjcj Version 1.04
authored
138 EOE
139 if ($@)
140 {
6627328 @pjcj Move modules into lib directory.
authored
141 print <<'EOM';
a036b0b @pjcj Version 1.04
authored
142 broken
143
144 You have a broken IO::Handle module. In particular, the input_line_number
145 method causes an error. Gedcom.pm will work around the problem, but if you
146 experience other problems with this function, or your use of $., you may wish to
147 solve the problem.
148
149 Perl 5.005_03 and (I believe) some developer releases have this problem, as does
150 IO.pm version 1.20. The problem is fixed as from 5.005_57. If you would like
151 to patch your Perl, my patch is available at
152 http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-04/msg02366.html
153 or send me mail.
154 EOM
155 }
156 else
157 {
6627328 @pjcj Move modules into lib directory.
authored
158 print "working\n";
a036b0b @pjcj Version 1.04
authored
159 }
160
1035bfc @pjcj Version 1.10
authored
161 print <<EOM if 0;
af7dbd3 @pjcj Version 1.09
authored
162
163 --------------------------------------------------------------------------------
164
165 I like to have some idea of the distribution of this software. To that end I
166 would be very grateful for mail from you. This will be used only to satisfy my
167 curiosity and to help me make decisions which may involve changes to the
168 module.
169
170 If you can run perlbug you can send me a success report with "make ok".
171 Failure reports with "make nok" are also appreciated.
172
1035bfc @pjcj Version 1.10
authored
173 EOM
174
175 print <<EOM;
176
177 --------------------------------------------------------------------------------
178
179 If you have any questions or comments please send a message to the perl-gedcom
180 mailing list, details of which are available in the README file.
af7dbd3 @pjcj Version 1.09
authored
181
182 EOM
a036b0b @pjcj Version 1.04
authored
183
36c030d @pjcj Version 1.01
authored
184 sub MY::postamble
185 {
6627328 @pjcj Move modules into lib directory.
authored
186 qq[
2829f22 @pjcj Version 1.02
authored
187 SET_VERSION = \$(PERL) -pi.version \\
188 -e 's/(^\\s*\\\$\$VERSION = ")\\d+\\.\\d+(";)/\$\${1}$Version\$\$2/;' \\
189 -e 's/(Version )\\d+\\.\\d+( - ).*/\$\${1}$Version\$\${2}$Date/;' \\
190 -e 's/(^\\s*use Gedcom(?:::\\w+)*\\s+)\\d+\\.\\d+;/\$\${1}$Version;/;'
191
36c030d @pjcj Version 1.01
authored
192 tags : @files
193 \t ptags @files
194
2829f22 @pjcj Version 1.02
authored
195 grammar :
196 \t \$(PERL) parse_grammar gedcom-5.5.grammar
2a1dc57 @pjcj Document WebServices.
authored
197 \t \$(SET_VERSION) -e 's/^ +//' lib/Gedcom/Grammar_5_5.pm
2829f22 @pjcj Version 1.02
authored
198
199 @versions : Makefile.PL
200 \t \$(SET_VERSION) @versions
36c030d @pjcj Version 1.01
authored
201
efef550 @pjcj Add xml web service and tests.
authored
202 README : lib/Gedcom.pm
2a1dc57 @pjcj Document WebServices.
authored
203 \t TERMCAP= COLUMNS=80 pod2text -s lib/Gedcom.pm | \\
36c030d @pjcj Version 1.01
authored
204 \$(PERL) -n \\
205 -e 'print if (/NAME/ ... /^[A-Z ]+\$\$/) =~ /^\\d+\$\$/;' \\
206 -e 'print if (/DESCRIPTION/ ... /^[A-Z ]+\$\$/) =~ /^\\d+\$\$/;' \\
207 > README
208
af7dbd3 @pjcj Version 1.09
authored
209 ppm : ppd pure_all
210 \t tar cf Gedcom.tar blib
211 \t gzip --best --force Gedcom.tar
212 \t \$(PERL) -pi.bak \\
213 -e 's/(OS NAME=")[^"]*/\$\$1MSWin32/;' \\
214 -e 's/(ARCHITECTURE NAME=")[^"]*/\$\$1MSWin32-x86-multi-thread/;' \\
215 -e 's/(CODEBASE HREF=")[^"]*/\$\$1Gedcom.tar.gz/;' \\
216 Gedcom.ppd
0190b44 @pjcj Version 0.01
authored
217
6627328 @pjcj Move modules into lib directory.
authored
218 tst :: pure_all test_clean run_tests
219
c418b73 @pjcj Version 1.13
authored
220 COVERDIR = /home/pjcj/g/perl/dev/Devel-Cover
aca2178 @pjcj Version 1.12
authored
221
222 cover :
a0eace9 @pjcj Skip ws_plain.t when mod_pelr is not available.
authored
223 \t \$(PERL) -Mblib=\$(COVERDIR) \$(COVERDIR)/cover -delete && \\
224 HARNESS_PERL_SWITCHES=-Mblib=\$(COVERDIR)\\ -MDevel::Cover=-ignore,Cover \$(MAKE) test && \\
225 \$(PERL) -Mblib=\$(COVERDIR) \$(COVERDIR)/cover -report html
aca2178 @pjcj Version 1.12
authored
226
6627328 @pjcj Move modules into lib directory.
authored
227 restart : all
2a1dc57 @pjcj Document WebServices.
authored
228 \t t/TEST -stop && rm -f t/logs/*log && t/TEST -start \$(TEST_OPTIONS)
6627328 @pjcj Move modules into lib directory.
authored
229
230 restart_cover : all
231 \t t/TEST -stop && cover && rm -f t/logs/*log && \\
2a1dc57 @pjcj Document WebServices.
authored
232 t/TEST -defines COVER -one-process -start \$(TEST_OPTIONS)
6627328 @pjcj Move modules into lib directory.
authored
233
234 stop : all
235 \t t/TEST -stop
236
237 runtestcover : all
238 \t rm -f t/logs/*log && \\
2a1dc57 @pjcj Document WebServices.
authored
239 DEVEL_COVER=1 t/TEST -defines COVER -one-process -verbose \$(TEST_OPTIONS) && \\
47e0748 @pjcj Add newline to die messages.
authored
240 cover -report html_basic
6627328 @pjcj Move modules into lib directory.
authored
241
242 mytestcover : all
243 \t cover -delete && \\
244 rm -f t/logs/*log && \\
2a1dc57 @pjcj Document WebServices.
authored
245 DEVEL_COVER=1 t/TEST -defines COVER -one-process \$(TEST_OPTIONS) && \\
47e0748 @pjcj Add newline to die messages.
authored
246 cover -report html_basic
6627328 @pjcj Move modules into lib directory.
authored
247
248 # cover : mytestcover
249
2a1dc57 @pjcj Document WebServices.
authored
250 cgi : all install
251 \t cp `dirname \$(PERL)`/gedcom.cgi cgi-bin && \\
252 rm *.ged && \\
253 ln -s ../ged/* .
254
af7dbd3 @pjcj Version 1.09
authored
255 ok :
256 \t \@$Perlbug -okay || echo "Please send your report manually to $Author"
0190b44 @pjcj Version 0.01
authored
257
af7dbd3 @pjcj Version 1.09
authored
258 nok :
259 \t \@$Perlbug -nokay || echo "Please send your report manually to $Author"
6627328 @pjcj Move modules into lib directory.
authored
260 ]
0190b44 @pjcj Version 0.01
authored
261 }
Something went wrong with that request. Please try again.