File: Makefile.PL

package info (click to toggle)
libfilter-perl 1.64-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 668 kB
  • sloc: perl: 963; makefile: 10
file content (187 lines) | stat: -rw-r--r-- 4,412 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
use ExtUtils::MakeMaker;

BEGIN
{
    die "Filters needs Perl version 5.005 or better, you have $]\n"
	if $] < 5.005 ;

    warn "Perl 5.6.0 or better is strongly recommended for Win32\n"
	if $^O eq 'MSWin32' && $] < 5.006 ;
}

use strict;

my @files = qw( t/filter-util.pl
             Call/Call.pm 
             Exec/Exec.pm 
             decrypt/decrypt.pm decrypt/decr decrypt/encrypt
             tee/tee.pm
             lib/Filter/cpp.pm lib/Filter/exec.pm lib/Filter/m4.pm lib/Filter/sh.pm
             examples/filtdef
             examples/method/Count.pm
             examples/method/NewSubst.pm
             examples/method/UUdecode.pm
             examples/method/Decompress.pm
             examples/method/Joe2Jim.pm
             examples/method/Subst.pm
             examples/closure/Count.pm
             examples/closure/NewSubst.pm
             examples/closure/UUdecode.pm
             examples/closure/Decompress.pm
             examples/closure/Include.pm
             examples/closure/Joe2Jim.pm
             examples/closure/Subst.pm
             examples/filtdef
             examples/filtuu
             t/call.t
             t/cpp.t
             t/decrypt.t
             t/exec.t
             t/m4.t
             t/order.t
             t/sh.t
             t/tee.t         
           );
             
if ($] < 5.006001) { oldWarnings(@files) }
# keep the src in the new-warnings style
#else { newWarnings(@files) }

WriteMakefile
  (
   DISTNAME     => 'Filter',
   NAME         => 'Filter::Util::Call',
   VERSION_FROM => 'Call/Call.pm',
   'linkext'    => {LINKTYPE => ''},
   'dist'       => {COMPRESS=>'gzip', SUFFIX=>'gz',
		   DIST_DEFAULT => 'tardist'},
   ($] >= 5.005
    ? (ABSTRACT	=> 'Source Filters',
       AUTHOR  	=> 'Paul Marquess <pmqs@cpan.org>')
    : ()
   ),

   INSTALLDIRS  => ($] >= 5.00703 && $] < 5.011 ? 'perl' : 'site'),

   ((ExtUtils::MakeMaker->VERSION() gt '6.30') ?
    ('LICENSE'  => 'perl', SIGN => 1)  : ()),
   ((ExtUtils::MakeMaker->VERSION() gt '6.46') ?
    ('META_MERGE'  =>
     {recommends =>
      {
	'Filter::Simple'          => '0.88',
        'Test::More'        => '0.88',
      },
      resources =>
      {
	license     => 'http://dev.perl.org/licenses/',
	repository  => 'https://github.com/rurban/Filter',
      }}) : ()),
   clean =>
   { FILES =>
       "t/FilterTry.pm *~ "
       ."META.yml MYMETA.yml MYMETA.json "
       ."decrypt/MYMETA.yml decrypt/MYMETA.json decrypt/Makefile.old decrypt/pm_to_blib decrypt/*.c decrypt/*.o "
       ."tee/MYMETA.yml tee/MYMETA.json tee/Makefile.old tee/pm_to_blib tee/*.c tee/*.o "
       ."Exec/MYMETA.yml Exec/MYMETA.json Exec/Makefile.old Exec/pm_to_blib Exec/*.c Exec/*.o "
       ."Call/MYMETA.yml Call/MYMETA.json Call/Makefile.old Call/pm_to_blib Call/*.c Call/*.o"
   }
  );

sub MY::libscan
{
    my $self = shift;
    my $path = shift;

    return undef
        if $path =~ /(~|\.bak)$/ || 
           $path =~ /^\..*\.swp$/ ;

    return $path;    
}

#sub MY::postamble 
#{
#	'
#
#MyDoubleCheck:	
#	@echo Checking for $$^W in files
#	@perl -ne \'						\
#	    exit 1 if /^\s*local\s*\(\s*\$$\^W\s*\)/;		\
#         \' ' . " @files || " . '				\
#	(echo found unexpected $$^W ; exit 1)
#	@echo All is ok.
#
#' ;
#}

sub MY::depend {
  "
release : test dist
	-git tag -f \$(VERSION)
	cpan-upload \$(DISTVNAME).tar\$(SUFFIX)
	git push
	git push --tags
";
}

{
    package MY;

    # Fun hack by cjwatson to get perlfilter.pod manified in section 1 with
    # all the other perl*.pod pages.
    sub constants {
	my ($self) = @_;
	$self->{MAN1PODS}->{'perlfilter.pod'} =
	    $self->catfile("\$(INST_MAN1DIR)", "perlfilter.\$(MAN1EXT)");
	delete $self->{MAN3PODS}->{'perlfilter.pod'};
	$self->SUPER::constants();
    }
}

sub oldWarnings
{
    local ($^I) = "" ;
    local (@ARGV) = @_ ;

    while (<>)
    {
	if (/^__END__/)
	{
	    print ;
	    my $this = $ARGV ;
    	    while (<>)
	    {
		last if $ARGV ne $this ;
		print ;
	    }
	}

	s/^(\s*)(no\s+warnings)/${1}local (\$^W) = 0; #$2/ ;
	s/^(\s*)(use\s+warnings)/${1}local (\$^W) = 1; #$2/ ;
	print ;
    }
}

sub newWarnings
{
    local ($^I) = "" ;
    local (@ARGV) = @_ ;

    while (<>)
    {
	if (/^__END__/)
	{
	    my $this = $ARGV ;
	    print ;
    	    while (<>)
	    {
		last if $ARGV ne $this ;
		print ;
	    }
	}

	s/^(\s*)local\s*\(\$\^W\)\s*=\s*\d+\s*;\s*#\s*((no|use)\s+warnings.*)/$1$2/ ;
	print ;
    }
}