5 use ExtUtils::MakeMaker;
7 my $dist = 're-engine-Hooks';
9 (my $name = $dist) =~ s{-}{::}g;
11 (my $file = $dist) =~ s{-}{/}g;
12 $file = "lib/$file.pm";
20 configure_requires => {
21 'ExtUtils::Depends' => 0,
22 'ExtUtils::MakeMaker' => 0,
26 'ExtUtils::Depends' => 0,
27 'ExtUtils::MakeMaker' => 0,
36 bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
37 homepage => "http://search.cpan.org/dist/$dist/",
38 license => 'http://dev.perl.org/licenses/',
39 repository => "http://git.profvince.com/?p=perl%2Fmodules%2F$dist.git",
48 my $len = length $version;
50 die "Invalid perl version";
52 $version .= '0' x (7 - $len);
56 my $versioned_file = File::Spec->catfile('src', $version, $file);
58 return -e $versioned_file ? $versioned_file : undef;
61 unless (defined versioned_file('regcomp.c')) {
63 This version of perl ($]) is not supported by this version of
64 re::engine::Hooks. If your perl has been recently released,
65 make sure there isn't a newer version of the module available
71 my @DEFINES = qw<-DPERL_EXT_RE_BUILD -DPERL_EXT>;
72 @DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
74 use ExtUtils::Depends;
76 my $ed = ExtUtils::Depends->new($name);
77 $ed->add_c('re_comp.c');
78 $ed->add_c('re_exec.c');
79 $ed->add_xs('Hooks.xs');
80 $ed->add_pm($file => do { local $_ = $file; s/^lib/\$(INST_LIB)/; $_ });
81 $ed->install('re_engine_hooks.h');
82 $ed->save_config('Files.pm');
84 my %ed_vars = $ed->get_makefile_vars;
85 $ed_vars{clean}->{FILES} .= ' ' . join ' ', (
88 qw<*.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt>,
89 qw<re_comp.c re_exec.c dquote_static.c>,
94 AUTHOR => 'Vincent Pit <perl@profvince.com>',
96 VERSION_FROM => $file,
97 ABSTRACT_FROM => $file,
99 PREREQ_PM => \%PREREQ_PM,
100 MIN_PERL_VERSION => '5.010001',
101 META_MERGE => \%META,
103 PREOP => "pod2text $file > \$(DISTVNAME)/README",
104 COMPRESS => 'gzip -9f', SUFFIX => 'gz'
106 XSPROTOARG => '-noprototypes',
109 boot_re__engine__Hooks
116 my $args_dat = './args.dat';
118 open my $fh, '>', $args_dat or die "open(>$args_dat): $!";
121 $arg =~ s{\s*(['"])\s*(.*)\s*\1\s*$}{$2}s;
122 $arg =~ s{([^=/.a-zA-Z0-9-])}{sprintf "[%d]", ord $1}ge;
130 my $regcomp_c = main::versioned_file('regcomp.c');
131 my $regexec_c = main::versioned_file('regexec.c');
132 my $dquote_static_c = main::versioned_file('dquote_static.c');
134 my $dquote_static_dep = defined $dquote_static_c ? 'dquote_static.c' : '';
137 re_comp.c : $regcomp_c
139 \$(CP) $regcomp_c re_comp.c
141 re_comp\$(OBJ_EXT) : re_comp.c $dquote_static_dep
143 re_exec.c : $regexec_c
145 \$(CP) $regexec_c re_exec.c
147 re_exec\$(OBJ_EXT) : re_exec.c
151 if (defined $dquote_static_c) {
153 dquote_static.c : $dquote_static_c
154 - \$(RM_F) dquote_static.c
155 \$(CP) $dquote_static_c dquote_static.c
161 configure_test.pl: args.dat
163 t/re-engine-Hooks-TestDist/Makefile: configure_test.pl
164 $(FULLPERLRUN) configure_test.pl
166 all clean:: t/re-engine-Hooks-TestDist/Makefile
167 cd t/re-engine-Hooks-TestDist && $(MAKE) $@