File: Makefile.PL

package info (click to toggle)
libgraphviz-perl 2.03-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 888 kB
  • ctags: 71
  • sloc: perl: 2,002; makefile: 52
file content (40 lines) | stat: -rw-r--r-- 1,128 bytes parent folder | download | duplicates (2)
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
use strict;
use Config;
use ExtUtils::MakeMaker;
use File::Spec::Functions;

print "Looking for dot... ";
my $found = find("dot");

if ($found) {
  print "found it at $found\n";
} else {
  print "didn't find it\n";
  die "****************************************************************
GraphViz.pm has not been able to find the graphviz program 'dot'
GraphViz.pm needs graphviz to function
Please install graphviz first: http://www.graphviz.org/
****************************************************************\n";
}

WriteMakefile(
            'NAME' => 'GraphViz',
    'VERSION_FROM' => 'lib/GraphViz.pm', # finds $VERSION
       'PREREQ_PM' => {
                       'IPC::Run' => 0.6,
                       'Test::More' => 0,
                      },
            'dist' => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
);

sub find {
  my $binary = shift;
  my $path = join ', ', @ENV{PATH};
  my $path_sep = $Config{path_sep};
  my $exe_ext = $Config{exe_ext};
  foreach my $dir (split $path_sep, @ENV{PATH}) {
    my $filename = catfile($dir, $binary);
    return $filename if -x "$filename$exe_ext";
  }
  return 0;
}