Make tests use strict and warnings. Cleanup the killing of activemq so that it happen...
[catagits/Catalyst-Engine-STOMP.git] / Makefile.PL
CommitLineData
b919b4cc 1use inc::Module::Install;
2use 5.008006;
48bc6cd6 3
68e73c9f 4license 'perl';
5
b919b4cc 6name 'Catalyst-Engine-Stomp';
7all_from 'lib/Catalyst/Engine/Stomp.pm';
48bc6cd6 8
b919b4cc 9requires 'Catalyst::Engine::Embeddable' => '0.0.1';
092efce5 10requires 'Catalyst::Runtime' => '5.80004';
b919b4cc 11requires 'Moose' => undef;
12requires 'MooseX::Workers' => '0.05';
48bc6cd6 13requires 'Net::Stomp' => '0.34';
b919b4cc 14requires 'YAML::XS' => '0.32';
a5ae1e8c 15requires 'Data::Serializer' => '0.49';
b919b4cc 16requires 'namespace::autoclean' => '0.05';
17
a431050d 18test_requires 'Alien::ActiveMQ' => '0.00003';
6ac87378 19
68e73c9f 20no_index package => 'StompTestApp';
625835bf 21no_index package => 'StompTestApp::Controller::TestController';
a5ae1e8c 22no_index package => 'StompTestApp::Controller::TestJsonController';
68e73c9f 23
e946eafd 24my @force_build_requires_if_author = qw(
25 Test::NoTabs
26 Test::Pod
27 Test::Pod::Coverage
28 Pod::Coverage
29);
30
31if ($Module::Install::AUTHOR) {
32 foreach my $module (@force_build_requires_if_author) {
33 build_requires $module;
34 }
35 darwin_check_no_resource_forks();
36}
37
38install_script glob('script/*.pl');
b919b4cc 39auto_install;
40WriteAll;
41
e946eafd 42if ($Module::Install::AUTHOR) {
43
44 # Strip out the author only build_requires from META.yml
45 # Need to do this _after_ WriteAll else it looses track of them
46 strip_author_only_build_requires(@force_build_requires_if_author);
47
48 Meta->{values}{resources} = [
49 [ 'license', => 'http://dev.perl.org/licenses/' ],
50 [ 'repository', => 'git://github.com/chrisa/catalyst-engine-stomp.git' ],
51 ];
52
53 Meta->write;
54}
55
56sub darwin_check_no_resource_forks {
57 if ($^O eq 'darwin') {
58 my $osx_ver = `/usr/bin/sw_vers -productVersion`;
59 chomp $osx_ver;
60
61 # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
62 # On 10.5 (Leopard) it wants COPYFILE_DISABLE
63 my $attr = $osx_ver eq '10.5' ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
64
65 makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
66 qq{ echo "You must set the ENV variable $attr to true,"; }.
67 ' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
68 }
69}
70
71sub strip_author_only_build_requires {
72 my @build_requires_to_strip = @_;
73 Meta->{values}{build_requires} = [ grep {
74 my $ok = 1;
75 foreach my $module (@build_requires_to_strip) {
76 if ($_->[0] =~ /$module/) {
77 $ok = 0;
78 last;
79 }
80 }
81 $ok;
82 } @{Meta->{values}{build_requires}} ];
83}
84