Declare a test_requires for ConfigLoader, since our test app uses it.
[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;
2b075013 12requires 'MooseX::Types' => undef;
b919b4cc 13requires 'MooseX::Workers' => '0.05';
48bc6cd6 14requires 'Net::Stomp' => '0.34';
b919b4cc 15requires 'YAML::XS' => '0.32';
a5ae1e8c 16requires 'Data::Serializer' => '0.49';
b919b4cc 17requires 'namespace::autoclean' => '0.05';
18
a431050d 19test_requires 'Alien::ActiveMQ' => '0.00003';
bff45299 20test_requires 'Catalyst::Plugin::ConfigLoader' => undef;
6ac87378 21
e946eafd 22my @force_build_requires_if_author = qw(
23 Test::NoTabs
24 Test::Pod
25 Test::Pod::Coverage
26 Pod::Coverage
27);
28
29if ($Module::Install::AUTHOR) {
30 foreach my $module (@force_build_requires_if_author) {
31 build_requires $module;
32 }
33 darwin_check_no_resource_forks();
34}
35
36install_script glob('script/*.pl');
b919b4cc 37auto_install;
38WriteAll;
39
e946eafd 40if ($Module::Install::AUTHOR) {
41
42 # Strip out the author only build_requires from META.yml
43 # Need to do this _after_ WriteAll else it looses track of them
44 strip_author_only_build_requires(@force_build_requires_if_author);
45
46 Meta->{values}{resources} = [
47 [ 'license', => 'http://dev.perl.org/licenses/' ],
48 [ 'repository', => 'git://github.com/chrisa/catalyst-engine-stomp.git' ],
49 ];
50
51 Meta->write;
52}
53
54sub darwin_check_no_resource_forks {
55 if ($^O eq 'darwin') {
56 my $osx_ver = `/usr/bin/sw_vers -productVersion`;
57 chomp $osx_ver;
58
59 # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
60 # On 10.5 (Leopard) it wants COPYFILE_DISABLE
21975e46 61 my $attr = $osx_ver =~ /^10.5/ ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
e946eafd 62
63 makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
64 qq{ echo "You must set the ENV variable $attr to true,"; }.
65 ' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
66 }
67}
68
69sub strip_author_only_build_requires {
70 my @build_requires_to_strip = @_;
71 Meta->{values}{build_requires} = [ grep {
72 my $ok = 1;
73 foreach my $module (@build_requires_to_strip) {
74 if ($_->[0] =~ /$module/) {
75 $ok = 0;
76 last;
77 }
78 }
79 $ok;
80 } @{Meta->{values}{build_requires}} ];
81}
82