File: Makefile.PL

package info (click to toggle)
libtime-format-perl 1.00-1.1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 188 kB
  • ctags: 35
  • sloc: perl: 373; makefile: 42
file content (61 lines) | stat: -rw-r--r-- 1,588 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
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
    'NAME'		=> 'Time::Format',
    'VERSION_FROM'	=> 'Format.pm', # finds $VERSION
    'PREREQ_PM'		=> {'Test::Simple' => '0.40'},
    ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
      (ABSTRACT_FROM => 'Format.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;
}