File: Makefile.PL

package info (click to toggle)
libtext-ngrams-perl 2.005-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 376 kB
  • ctags: 46
  • sloc: perl: 670; makefile: 9
file content (42 lines) | stat: -rw-r--r-- 1,118 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
use ExtUtils::MakeMaker;

my $module = 'Text::Ngrams';
my $name   = 'Ngrams.pm';
(my $dir = $module) =~ s/::/-/g;

WriteMakefile (
   'NAME'       => $module,
   'VERSION_FROM' => $name, # finds $VERSION
   'dist' => { COMPRESS=>"gzip",
               SUFFIX=>"gz",
               #PREOP=>('starfish -replace -o=$dir-\$(VERSION)/README README.sfish'
               #        #."cp -f README $dir-\$(VERSION); "
               #       ),
             },
   'clean' => {FILES => "tmp* testfiles/tmp1 Text *~ Makefile.old"},
   'PREREQ_PM' => {
		   # Foo::Ey => '1.00',
		  },
   'PL_FILES' => {},
   ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
    (ABSTRACT_FROM => $name, # retrieve abstract from module
     AUTHOR     => 'Vlado Keselj web.cs.dal.ca/~vlado') : 
    ()
    ),
    EXE_FILES => [ 'ngrams.pl' ],
   );

open(M, ">>Makefile") or die;

if ( -f 'priv.make' ) { print M getfile('priv.make') }

close(M);

sub getfile($) {
    my $f = shift;
    local *F;
    open(F, "<$f") or die "getfile:cannot open $f:$!";
    my @r = <F>;
    close(F);
    return wantarray ? @r : join ('', @r);
}