File: Makefile.PL

package info (click to toggle)
libnet-cve-perl 0.009-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 168 kB
  • sloc: perl: 504; makefile: 15
file content (111 lines) | stat: -rw-r--r-- 2,798 bytes parent folder | download
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
use strict;

require 5.014002;

use ExtUtils::MakeMaker;
use File::Copy;

sub link_or_copy {
    my ($source, $dest) = @_;

    link ($source, $dest) or copy ($source, $dest);
    } # link_or_copy

my @exe;
unless (exists $ENV{AUTOMATED_TESTING} and $ENV{AUTOMATED_TESTING} == 1) {
    for ( [ "cve.pl",	"CLI to Net::CVE"	],
	  ) {
	prompt ("Do you want to install $_->[0]\t$_->[1] ?", "y") =~ m/[Yy]/ and
	    push @exe => "scripts/$_->[0]";
	}
    }
my %wm = (
    NAME         => "Net::CVE",
    DISTNAME     => "Net-CVE",
    ABSTRACT     => "Fetch CVE info from cve.org",
    AUTHOR       => "H.Merijn Brand <hmbrand\@cpan.org>",
    VERSION_FROM => "lib/Net/CVE.pm",
    LICENSE      => "perl",
    EXE_FILES    => [ @exe ],
    PREREQ_FATAL => 0,
    PREREQ_PM    => {
	# Core modules
	"Carp"			=> 0,
	"HTTP::Tiny"		=> 0.025,
	"JSON::MaybeXS"		=> 1.004005,
	"List::Util"		=> 0,

	# For https
	"IO::Socket::SSL"	=> 1.42,

	# For testing
	"Test::More"		=> 0.90,
	"Test::Warnings"	=> 0,
	},
    macro        => { TARFLAGS   => "--format=ustar -c -v -f", },
    );

if ($ENV{EXTENDED_TESTING}) { # for CpanCover and masochists
    # Backend parsers, all optional
    #$wm{PREREQ_PM}{"Net::OSV"}		= "0.0.1";
    #$wm{PREREQ_PM}{"Net::NSD"}		= "0.0.1";
    }

my $rv = WriteMakefile (%wm);

# perlcriticrc uses Config::Tiny, which does not support nesting
if (-f ".perlcriticrc" && -s "$ENV{HOME}/.perlcriticrc") {
    open my $fh, ">", ".perlcriticrc";
    print $fh do {
	local (@ARGV, $/) = ("$ENV{HOME}/.perlcriticrc");
	<> =~ s{^hard_max = \K\d+$}{150}rm };
    print $fh join "\n" => "",
	"[-Community::EmptyReturn]",	#
	"[-Community::Wantarray]",	#
	"";
    close $fh;
    }

package MY;

sub postamble {
    my @pc = -f ".perlcriticrc" ? ("\tperlcritic -1 lib/Net/CVE.pm") : ();
    -d "xt" && ($ENV{AUTOMATED_TESTING} || 0) != 1 and push @pc,
	'',
	'test::',
	'	-@env TEST_FILES="xt/*.t" make -e test_dynamic';
    join "\n" =>
	'cover test_cover:',
	'	ccache -C',
	'	cover -test',
	'',
	'spellcheck:',
	'	pod-spell-check --aspell --ispell lib',
	'',
	'checkmeta:	spellcheck',
	'	perl sandbox/genMETA.pl -c',
	'',
	'fixmeta:	distmeta',
	'	perl sandbox/genMETA.pl',
	'	ls -l */META.yml',
	'',
	'tgzdist:	checkmeta fixmeta $(DISTVNAME).tar.gz distcheck',
	'	-@mv -f $(DISTVNAME).tar.gz $(DISTVNAME).tgz',
	'	-@cpants_lint.pl $(DISTVNAME).tgz',
	'	-@rm -f Debian_CPANTS.txt',
	'',
	'doc docs:		doc/Net-CVE.md doc/Net-CVE.html doc/Net-CVE.man',
	'	-@rm -f pod2html.tmp',
	'doc/Net-CVE.md:	lib/Net/CVE.pm',
	'	pod2markdown  < $? > $@',
	'doc/Net-CVE.html:	lib/Net/CVE.pm',
	'	pod2html      < $? 2>&1 | grep -v "^Cannot find" > $@',
	'doc/Net-CVE.3:		lib/Net/CVE.pm',
	'	pod2man       < $? > $@',
	'doc/Net-CVE.man:	doc/Net-CVE.3',
	'	nroff2man     < $? > $@',
	@pc,
	'';
    } # postamble

1;