File: Makefile.PL

package info (click to toggle)
asused 3.72-7
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 524 kB
  • ctags: 159
  • sloc: perl: 3,494; sh: 129; makefile: 47
file content (64 lines) | stat: -rw-r--r-- 1,666 bytes parent folder | download | duplicates (7)
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 Config;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

# RIPE NCC common configuration
my %PARAM = (
    'INSTALLDIRS'	=> 'vendor',
    'INSTALLSCRIPT'	=> '$(INSTALLVENDORBIN)', # Hack for Perl prior 5.8.1
    'dist'		=> {
	'COMPRESS'	=> 'gzip', 
	    'SUFFIX'	=> '.gz',
	    'CI'	=> 'cvs ci',
	    'RCS_LABEL'	=> 'cvs tag -c -F $(NAME_SYM)-$(VERSION_SYM)',
    },
);

if($] >= 5.005) {
    $PARAM{AUTHOR}		= 'Timur Bakeyev <timur@ripe.net>';
}

my $script_name = 'asused3';
my $private = (-f '/ncc/registries/zz.example') ? 1 : 0;

unless($private) {
    $script_name = 'asused';
    $PARAM{INSTALLDIRS} = 'site';
    $PARAM{INSTALLSCRIPT} = '$(INSTALLSITEBIN)';
}

WriteMakefile(
    'NAME'	=> 'asused',
    'PREREQ_PM'	=> {
	'IO::Socket'	=> '1.20', # We would like to have quiet modern IO::Socket
    },
    'VERSION_FROM'=> 'asused.PL', # finds $VERSION
    'EXE_FILES'	=> [ $script_name ],
    'PL_FILES'	=> { 'asused.PL' => $script_name },
    'clean'	=> { 'FILES' => $script_name },
    %PARAM
);   

# Ugly hack to deal with Perl prior 5.00503
sub MY::processPL {
    my($self) = shift;
    return "" unless $self->{PL_FILES};
    my(@m, $plfile);
    foreach $plfile (sort keys %{$self->{PL_FILES}}) {
        my $list = ref($self->{PL_FILES}->{$plfile})
		? $self->{PL_FILES}->{$plfile}
		: [$self->{PL_FILES}->{$plfile}];
	my $target;
	foreach $target (@$list) {
	push @m, "
all :: $target
	$self->{NOECHO}\$(NOOP)

$target :: $plfile
	\$(PERL) -I\$(INST_ARCHLIB) -I\$(INST_LIB) -I\$(PERL_ARCHLIB) -I\$(PERL_LIB) $plfile $target
";
	}
    }
    join "", @m;
}