root/libswish3/tags/10Feb2008/libswish3.build

Revision 1923, 1.4 kB (checked in by karpet, 2 years ago)

expose the tokenizer into Perl space for benchmarking

Line 
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Carp;
7 use File::Path;
8
9 my $tmp      = '/tmp/swish3.build';
10 my $htdocs   = '/opt/trac/swish3/htdocs';
11 my $doc      = $htdocs . '/doc';
12 my $dl       = $htdocs . '/download';
13 my $podIndex = $doc . '/index.html';
14
15 mkpath([$tmp, $doc, $dl], 1);
16
17 chdir($tmp) or croak "can't chdir $tmp: $!";
18
19 # update src
20 shell("svn up") or croak $!;
21
22 # make dist
23 shell("./bootstrap 2>/dev/null", 1) or croak $!;
24 shell("./configure", 1) or croak $!;
25 shell("make",        1) or croak $!;
26 shell("make test",   1) or croak $!;
27 shell("make dist",   1) or croak $!;
28 shell("cp SwishParser-*.tar.gz $dl/") or croak $!;
29
30 # make html docs
31 chdir('doc') or croak "can't chdir doc/: $!";
32
33 open(P, ">$podIndex") or croak "can't write $podIndex: $!";
34 print P "<html><head><title>SwishParser Documentation</title>\n";
35 print P
36   '<link rel="stylesheet" href="http://search.cpan.org/s/style.css" type="text/css" />';
37 print P "\n</head><body>\n";
38 print P "<ul>";
39 for my $pod (
40       qw/ swish_lint.1 swish_words.1 swish_isw.1 libswish3.3 /)
41 {
42     shell(
43         "pod2html --css=http://search.cpan.org/s/style.css --infile=$pod.pod --outfile=$doc/$pod.html"
44       )
45       or croak $!;
46
47     print P qq{<li><a href="./$pod.html">$pod</a></li>\n};
48 }
49
50 print P "\n</ul></body></html>\n";
51 close(P);
52
53 sub shell
54 {
55     my $cmd = shift;
56     my $quiet = shift || 0;
57     $cmd .= " 1>/dev/null" if $quiet;
58     print $cmd, "\n";
59     my $r = system($cmd);
60     return $r ? 0 : 1;
61 }
Note: See TracBrowser for help on using the browser.