root/lang/perl/Lingua-JA-TFIDF/trunk/Makefile.PL @ 22301

Revision 22301, 0.7 kB (checked in by miki, 6 years ago)

再アップ

Line 
1use inc::Module::Install;
2
3&replace_perl_path;
4
5name 'Lingua-JA-TFIDF';
6all_from 'lib/Lingua/JA/TFIDF.pm';
7
8requires('List::MoreUtils');
9requires('Storable');
10requires('Class::Accessor::Fast');
11requires('Class::Data::Inheritable');
12requires('LWP::UserAgent');
13requires('XML::TreePP');
14requires('Carp');
15requires('HTML::Feature');
16build_requires 'Test::More';
17use_test_base;
18auto_install;
19
20install_script('script/tfidf');
21WriteAll;
22
23sub replace_perl_path {
24    my $perl_path = `which perl`;
25    open(SCRIPT, "+<script/tfidf");
26    my @code = <SCRIPT>;
27    return if $code[0] =~ /^#!/;
28    seek(SCRIPT,0,0);
29    print SCRIPT '#!' . $perl_path . "\n";
30    for(@code){
31        print SCRIPT $_;
32    }
33    truncate(SCRIPT,tell);
34    close(SCRIPT);
35}
Note: See TracBrowser for help on using the browser.