File: Makefile.PL

package info (click to toggle)
libiterator-util-perl 0.02%2Bds1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 136 kB
  • sloc: perl: 234; makefile: 2
file content (64 lines) | stat: -rw-r--r-- 1,735 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
    'NAME'		=> 'Iterator::Util',
    'VERSION_FROM'	=> 'Util.pm', # finds $VERSION
    'PREREQ_PM'		=> {'Test::Simple'     => '0.40',
                            'Exception::Class' => '1.21',
                            'Iterator'         => '0.01',
                           },
    ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
      (ABSTRACT_FROM => 'Util.pm', # retrieve abstract from module
       AUTHOR     => 'Eric Roode <roode@cpan.org>') : ()),
);


package MY;

sub dist_core
{
    my $text = shift->SUPER::dist_core(@_);
    $text =~ s/^(\$\(DISTVNAME\)[^:]*): (.*)/$1: ppd ppm $2/mg;
    return $text;
}

sub realclean
{
    my $text = shift->SUPER::realclean(@_);
    $text .= <<'CLEAN';
	rm -rf $(PPDFILE) $(PPMFILE)
CLEAN
    return $text;
}

sub ppd
{
    my $self = shift;
    my $text = $self->SUPER::ppd(@_);
    $text =~ s/(ppd\s*:)/$1 \$(PPDFILE)\n\n\$(PPDFILE) :/;
    $text =~ s[(?<=<CODEBASE HREF=\\")]
              [http://search.cpan.org/src/ROODE/$self->{DISTNAME}-$self->{VERSION}/$self->{DISTNAME}-ppm.tar.gz];

    # This release is allegedly OS and architecture independent (as it's pure perl)
    $text =~ s/<OS NAME[^>]+>(?:\\[nt])*//;
    $text =~ s/<ARCHITECTURE NAME[^>]+>(?:\\[nt])*//;

    $text = <<'PRE' . $text;

PPMNAME = $(DISTNAME)-ppm
PPDFILE = $(DISTNAME).ppd
PPMFILE = $(PPMNAME).tar.gz

PRE

    $text .= <<'PPM';


ppm: $(PPMFILE)

$(PPMFILE): pm_to_blib $(INST_LIBDIR)/.exists $(INST_ARCHAUTODIR)/.exists $(INST_AUTODIR)/.exists
	$(TAR) $(TARFLAGS) - blib | $(COMPRESS) -c > $(PPMFILE)
PPM
    return $text;
}