File: Makefile.PL

package info (click to toggle)
libpod-constants-perl 0.16-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 88 kB
  • ctags: 15
  • sloc: perl: 296; makefile: 45
file content (43 lines) | stat: -rw-r--r-- 1,332 bytes parent folder | download | duplicates (3)
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
43
use ExtUtils::MakeMaker;

# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

# Extract the version from the file.  I don't think it's right to use
# my own module to do this, so resort to something that should work
# everywhere :-)
my $VERSION;
open FOO, "<Constants.pm" or die $!;
while ( <FOO> ) {
    last if ($VERSION) = m/^\s*\$VERSION\s*=\s*(\d+\.\d+)/;
}
close FOO;

# If this function is not called manually on older versions of
# ExtUtils::MakeMaker, it goes tits up.
ExtUtils::MakeMaker::full_setup();

# "MM" comes from the "ExtUtils::MakeMaker" package
my $mm = MM->new({
    'NAME'		=> 'Pod::Constants',
    'VERSION'		=> $VERSION,
    'PREREQ_PM'		=> { Pod::Parser => 1.13,
			     Test::Simple => 0.18,
			   },
    ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
      (ABSTRACT_FROM => 'Constants.pm', # retrieve abstract from module
       AUTHOR     => 'Sam Vilain <sam@vilain.net>') : ()),
});

if (open MAKEMAKERISAHORRIDHACK, ">t/perlpath") {
    print MAKEMAKERISAHORRIDHACK $mm->{FULLPERL},"\n";
    close MAKEMAKERISAHORRIDHACK;
} else {
    warn("could not open t/perlpath for writing; $!.  It is remotely "
	 ."possible that some of the test scripts will test against "
	 ."the wrong version of perl.");
}

$mm->flush();

0;