Remove this module back to other repo.
[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
e946eafd 20my @force_build_requires_if_author = qw(
21 Test::NoTabs
22 Test::Pod
23 Test::Pod::Coverage
24 Pod::Coverage
25);
26
27if ($Module::Install::AUTHOR) {
28 foreach my $module (@force_build_requires_if_author) {
29 build_requires $module;
30 }
31 darwin_check_no_resource_forks();
32}
33
34install_script glob('script/*.pl');
b919b4cc 35auto_install;
36WriteAll;
37
e946eafd 38if ($Module::Install::AUTHOR) {
39
40 # Strip out the author only build_requires from META.yml
41 # Need to do this _after_ WriteAll else it looses track of them
42 strip_author_only_build_requires(@force_build_requires_if_author);
43
44 Meta->{values}{resources} = [
45 [ 'license', => 'http://dev.perl.org/licenses/' ],
46 [ 'repository', => 'git://github.com/chrisa/catalyst-engine-stomp.git' ],
47 ];
48
49 Meta->write;
50}
51
52sub darwin_check_no_resource_forks {
53 if ($^O eq 'darwin') {
54 my $osx_ver = `/usr/bin/sw_vers -productVersion`;
55 chomp $osx_ver;
56
57 # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE
58 # On 10.5 (Leopard) it wants COPYFILE_DISABLE
59 my $attr = $osx_ver eq '10.5' ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE';
60
61 makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}.
62 qq{ echo "You must set the ENV variable $attr to true,"; }.
63 ' echo "to avoid getting resource forks in your dist."; exit 255; fi' });
64 }
65}
66
67sub strip_author_only_build_requires {
68 my @build_requires_to_strip = @_;
69 Meta->{values}{build_requires} = [ grep {
70 my $ok = 1;
71 foreach my $module (@build_requires_to_strip) {
72 if ($_->[0] =~ /$module/) {
73 $ok = 0;
74 last;
75 }
76 }
77 $ok;
78 } @{Meta->{values}{build_requires}} ];
79}
80