#!/usr/bin/perl -w                                         # -*- perl -*-

use strict;
use lib qw( ./lib );
use ExtUtils::MakeMaker;
$|++;

WriteMakefile(
    NAME              => 'RENA',
    EXE_FILES         => [qw!util/rena.pl!],
    VERSION_FROM      => 'RENA.pm',
    PREREQ_PM         => { 'Biblio::Thesaurus' => '0.17',
      'Lingua::Jspell' => '0.05',
      'XML::DOM' => '1.27',
      'YAML' => '0.35',
      'CGI' => '2.81',
    },
    ($] >= 5.005 ?
    (ABSTRACT_FROM  => 'RENA.pm',
    AUTHOR         => 'Edgar Alves') : ()),
);


package MY;

sub postamble {
      return <<"EOF";
filterdata:
\tperl ./util/gencontext.pl < ./data/contextos > ./data/gen_context.pl
\tperl ./util/install-data.pl

cleanfilterdata:
\trm -f ./data/gen_context.pl
EOF
}

sub test {
    my $class = shift;
    my $makefragment = $class->SUPER::test(@_);
    $makefragment =~ s/^(test ::)/$1 filterdata/m;
    return $makefragment;
}

sub install {
    my $class = shift;
    my $makefragment = $class->SUPER::install(@_);
    $makefragment =~ s/^(install ::)/$1 filterdata/m;
    return $makefragment;
}

sub clean {
    my $class = shift;
    my $makefragment = $class->SUPER::clean(@_);
    $makefragment =~ s/^(clean ::)/$1 cleanfilterdata/m;
    return $makefragment;
}

