1#!perl
2use strict;
3use warnings;
4use ExtUtils::MakeMaker;
5
6
7my %parms = (
8    NAME                => 'Perl::Critic::Bangs',
9    AUTHOR              => 'Andy Lester <andy@petdance.com>',
10    VERSION_FROM        => 'lib/Perl/Critic/Bangs.pm',
11    ABSTRACT            => 'Perl::Critic::Bangs - A collection of policies for Perl::Critic',
12    PL_FILES            => {},
13    PREREQ_PM => {
14        'Perl::Critic'                  => 1.098,
15        'Perl::Critic::Policy'          => 0,
16        'Perl::Critic::PolicyFactory'   => 0,
17        'Perl::Critic::PolicyParameter' => 0,
18        'Perl::Critic::TestUtils'       => 0,
19        'Perl::Critic::UserProfile'     => 0,
20        'Perl::Critic::Utils'           => 0,
21        'Perl::Critic::Violation'       => 0,
22        'PPI::Cache'                    => 0,
23        'PPI::Document'                 => 0,
24        'Readonly'                      => 0,
25        'Test::More'                    => 0,
26        'Test::Perl::Critic'            => 1.01,
27    },
28    LICENSE             => 'perl',
29
30    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
31    clean               => { FILES => 'Perl-Critic-Bangs-*' },
32);
33
34if ( $ExtUtils::MakeMaker::VERSION ge '6.46' ) {
35    $parms{META_MERGE} = {
36        resources => {
37            license     => 'http://dev.perl.org/licenses/',
38            repository  => 'git://github.com/petdance/perl-critic-bangs.git',
39        }
40    };
41}
42
43WriteMakefile( %parms );
44
45package MY;
46sub MY::libscan {
47    my $self = shift;
48    my $path = shift;
49
50    $path = $self->SUPER::libscan($path);
51
52    # I have a bunch of symlinks in the root.  Ignore them.
53    return '' if -l $path;
54    return $path;
55};
56
57sub MY::postamble {
58    return <<'MAKE_FRAG';
59.PHONY: tags critic
60
61tags:
62	ctags -f tags --recurse --totals \
63		--exclude=blib --exclude=t/lib \
64		--exclude=.svn --exclude='*~' \
65		--languages=Perl --langmap=Perl:+.t \
66		lib/ t/
67
68critic:
69	perlcritic -profile perlcriticrc -1 -quiet lib/ t/ Makefile.PL
70
71MAKE_FRAG
72}
73