File: Builder.pm

package info (click to toggle)
libpdf-fdf-simple-perl 0.21-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,004 kB
  • sloc: perl: 15,109; makefile: 7
file content (68 lines) | stat: -rw-r--r-- 1,259 bytes parent folder | download | duplicates (4)
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
package PDF::FDF::Simple::Builder;

use strict;
use warnings;

use Module::Build;
use File::Copy "mv";

use vars qw(@ISA);
@ISA = ("Module::Build");

sub ACTION_grammar
{
        require Parse::RecDescent;

        my $grammar_file ='lib/auto/PDF/FDF/Simple/grammar';
        open GRAMMAR_FILE, $grammar_file or die "Cannot open grammar file ".$grammar_file;
        local $/;
        my $grammar = <GRAMMAR_FILE>;

        Parse::RecDescent->Precompile($grammar, "PDF::FDF::Simple::Grammar");
        my $target = "lib/PDF/FDF/Simple/Grammar.pm";
        mv "Grammar.pm", $target;
        print "Updated $target\n";
}


1;

=pod

=head1 NAME

PDF::FDF::Simple::Builder - Module::Build extensions for PDF::FDF::Simple

=head1 SYNOPSIS

 perl Build.PL
 ./Build grammar
 ./Build
 ./Build test
 ./Build install

=head1 DESCRIPTION

Provides Module::Build extensions, mainly for precompiling the grammar
file.

=head1 FUNCTIONS

=head2 ACTION_grammar

This defines an Build action C<grammar> which precompiles the grammar
using Parse::RecDescent and moves the file to
lib/PDF/FDF/Simple/Grammar.pm. It is usually done by the maintainer,
before he builds a dist file for CPAN.

=head1 AUTHOR

=over 4

=item *

Steffen Schwigon <ss5@renormalist.net>,

=back

=cut